http://iotn.co.kr 연락처: gilho.kr@gmail.com [ The Japanese government should apologize to Japanese Military Sexual Slavery victim. / 日本政府は日本軍の性的奴隷?牲者に謝罪すべき. ]

사용자

ID:
PW:

INDEX
01.게시판
게시판 [69]
02.File Book
File 자료실 [95]
Site Link [18]
개인폴더 [194]
03.Field Book
Altibase [19]
Tibero [30]
MS-SQL [18]
MySQL [40]
DB2 [79]
ORACLE [2888]
PostgreSQL [103]
기타정보 [150]
운영체제 [577]
04.Q/A Book
Q/A [53]
05.방명록
방명록 [54]
레벨업 [37]
구인/구직 [2]

기념일
Search
LINK
+ 가족 Hompy
+ DNSEver
IOTN :: Work Book :: MySQL

 회원가입

MariaDB default datadir 변경 [ datafile 위치 변경 ] test version 10.4
최길호 [LIST]   2020-05-29 18:04:39, 조회 : 269

MariaDB [(none)]> select @@datadir;
+-----------------+
| @@datadir       |
+-----------------+
| /var/lib/mysql/ |
+-----------------+
1 row in set (0.000 sec)

root#
systemctl stop mariadb
systemctl status mariadb
mkdir /data
rsync -av /var/lib/mysql /data/
mv /var/lib/mysql /var/lib/mysql.bak

vi /etc/my.cnf
[client-server]
socket=/data/mysql/mysql.sock
[mysqld]
datadir=/data/mysql


## 기존 정보
!includedir /etc/my.cnf.d

semanage fcontext -a -t mysqld_db_t "/data/mysql(/.*)?"
restorecon -R /data/mysql

systemctl start mariadb

MariaDB [(none)]> select @@datadir;
+--------------+
| @@datadir    |
+--------------+
| /data/mysql/ |
+--------------+
1 row in set (0.000 sec)

MariaDB [(none)]>

출처: https://www.tecmint.com/change-default-mysql-mariadb-data-directory-in-linux/


위 정보 다시 보고 하면 에러 안날듯.
[root@node1 mysql]# systemctl start mariadb
Job for mariadb.service failed because the control process exited with error code. See "systemctl status mariadb.service" and "journalctl -xe" for details.
[root@node1 mysql]# systemctl status mariadb.service
● mariadb.service - MariaDB 10.4.13 database server
   Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor preset: disabled)
  Drop-In: /etc/systemd/system/mariadb.service.d
           └─migrated-from-my.cnf-settings.conf
   Active: failed (Result: exit-code) since Fri 2020-05-29 04:48:28 EDT; 8s ago
     Docs: man:mysqld(8)
           https://mariadb.com/kb/en/library/systemd/
  Process: 2943 ExecStartPost=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
  Process: 5053 ExecStart=/usr/sbin/mysqld $MYSQLD_OPTS $_WSREP_NEW_CLUSTER $_WSREP_START_POSITION (code=exited, status=1/FAILURE)
  Process: 5034 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VAR= ||   VAR=`cd /usr/bin/..; /usr/bin/galera_recovery`; [ $? -eq 0 ]   && systemctl set-environment _WSREP_START_POSITION=$VAR || exit 1 (code=exited, status=0/SUCCESS)
  Process: 5031 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
Main PID: 5053 (code=exited, status=1/FAILURE)
   Status: "MariaDB server is down"

May 29 04:48:28 node1 mysqld[5053]: 2020-05-29  4:48:28 0 [ERROR] Plugin 'InnoDB' init function returned error.
May 29 04:48:28 node1 mysqld[5053]: 2020-05-29  4:48:28 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
May 29 04:48:28 node1 mysqld[5053]: 2020-05-29  4:48:28 0 [Note] Plugin 'FEEDBACK' is disabled.
May 29 04:48:28 node1 mysqld[5053]: 2020-05-29  4:48:28 0 [ERROR] Could not open mysql.plugin table. Some plugins may be not loaded
May 29 04:48:28 node1 mysqld[5053]: 2020-05-29  4:48:28 0 [ERROR] Failed to initialize plugins.
May 29 04:48:28 node1 mysqld[5053]: 2020-05-29  4:48:28 0 [ERROR] Aborting
May 29 04:48:28 node1 systemd[1]: mariadb.service: main process exited, code=exited, status=1/FAILURE
May 29 04:48:28 node1 systemd[1]: Failed to start MariaDB 10.4.13 database server.
May 29 04:48:28 node1 systemd[1]: Unit mariadb.service entered failed state.
May 29 04:48:28 node1 systemd[1]: mariadb.service failed.
Hint: Some lines were ellipsized, use -l to show in full.
[root@node1 mysql]#




  LIST

Copyright 1999-2022 Zeroboard / skin by 최길호(gilho.kr@gmail.com)
최근 댓글
2008/12/15
MySQL이 안좋은건가? 장애도 쉽게 나고,...
by 최길호
최근 게시물
06/29
[ORACLE]
DDE: Problem Key 'ORA 600 [133....
by 최길호
06/25
[ORACLE]
Replication may not be valid i....
by 최길호
06/22
[운영체제]
CentOS7 홈페이지 Migration 메모.
by 최길호