[ 작업 환경 ]

 

Centos 7

MariaDB-5.5

 

 

 

 

 [ 문제 상황 ]

 

필자의 경우 /etc/my.cnf 파일의 datadir 설정값을 변경한 후 해당 문제가 발생했습니다.

 

Job for mariadb.service failed because the control process exited with error code. See "systemctl status mariadb.service" and "journalctl -xe" for details.

 

mariadb-prepare-db-dir[9708]: chown: changing ownership of '/DB': Operation not permitted
mariadb-prepare-db-dir[9708]: chmod: changing permissions of '/DB': Operation not permitted
mariadb-prepare-db-dir[9708]: Initializing MariaDB database
mariadb-prepare-db-dir[9708]: chown: changing ownership of '/DB': Operation not permitted
mariadb-prepare-db-dir[9708]: Cannot change ownership of the database directories to the 'mysql'
mariadb-prepare-db-dir[9708]: user.  Check that you have the necessary permissions and try again.
mariadb-prepare-db-dir[9708]: Initialization of MariaDB database failed.
mariadb-prepare-db-dir[9708]: Perhaps @sysconfdir@/my.cnf is misconfigured or there is some problem with permissions of /DB.
mariadb-prepare-db-dir[9708]: Initialization of MariaDB database was not finished successfully.
mariadb-prepare-db-dir[9708]: Files created so far will be removed.
systemd[1]: mariadb.service: control process exited, code=exited status=1
systemd[1]: Failed to start MariaDB database server.

 

 

 

 

 

 [ 문제 원인 ]

 

datadir로 설정한 /DB 의 소유자가 mysql에서 컨트롤할 수 없는 세팅이기 때문입니다.

chown -R mysql: /DB

 

 

 

 

 

 [ 문제 해결 완료 ]

 

 

 

 

+ Recent posts