The website suddenly couldn't connect to the database, so I restarted the server directly. Enter the cli mode, execute service myqsld start and find that the error message "MySQL deamon failed to start" is still prompted
# /etc/init.d/mysqld start
MySQL Daemon failed to start.
Starting mysqld: [FAILED]
View the mysqld log file
#less /var/log/mysqld.log
One of the lines is:
/usr/libexec/mysqld: Can't change dir to ‘XXX' (Errcode: 13)
First check the database log
[Warning] Can't create test file xxx.lower-test [Warning] Can't create test file xxx.lower-test /usr/libexec/mysqld: Can't change dir to '/xxx' (Errcode: 13) [ERROR] Aborting
First check the permissions and user names of the data directory and log directory , there is no problem with the permissions and the user it belongs to. It should be that the permissions of SELINUX are restricted.
# getenforce
Enforcing
means that SELinux has been enabled. It only needs to be turned off.
Close method:
#setenforce 0 (0|1 开|关)
or
setsebool ftpd_disable_trans 1
The above is the solution to the MySQL prompt "mysql deamon failed to start" error. For more related content, please pay attention to PHP Chinese Net (m.sbmmt.com)!