更改了mysql的配置文件,重新啟動的時候發現:啟動失敗:
Job for mysqld.service failed because the control process exited with error code. See "systemctl status mysqld.service" and "journalctl -xe" for details.
查看日志:
Loaded: loaded (/etc/rc.d/init.d/mysqld; bad; vendor preset: disabled)
Can't create test file /home/mysql/data/d064lh.lower-test
原因就是
SELinux惹的禍
通俗的講就是linux服務器的安全策略
這個文章可以看看:https://linux.cn/article-7317-1.html
https://www.iteye.com/blog/jejoker-1882028
解決:
臨時關閉:setenforce 0
永久關閉需要修改配置文件,重啟機器:
修改/etc/selinux/config 文件
將SELINUX=enforcing改為SELINUX=disabled
也有可能是
apparmor問題
https://www.cnblogs.com/Amaranthus/p/5738332.html