站在巨人的肩膀上
問題背景:
mariadb版本:10.1.38
mariadb啟動提示
[Note] /usr/libexec/mysqld (mysqld 10.0.21-MariaDB) starting as process 8005 ...
[Warning] Can't create test file /home/data/mariadbData/localhost.lower-test
mariadb.service: main process exited, code=exited, status=1/FAILURE
Failed to start MariaDB 10.3.9 database server.
問題解決
產(chǎn)生原因:
由于在將mariadb的數(shù)據(jù)目錄修改至home路徑下,但是mariadb并沒有home路徑的權(quán)限。所以導(dǎo)致執(zhí)行systemctl start mariadb時產(chǎn)生上述問題蜕着。
解決方法:
- 關(guān)閉selinux
setenforce 0
- 修改mariadb數(shù)據(jù)目錄下的權(quán)限
chown -R mysql:mysql /home/mysqldatadir
chown -R 764 /home/mysqldatadir
3.修改mariadb.service.d的配置文件
vim /etc/systemd/system/mariadb.service.d/homedir.conf
添加
[Service]
ProtectHome=false
$ systemctl daemon-reload
$ systemctl start mariadb