Home  >  Article  >  Database  >  MySQL - Solution to the error "mysql deamon failed to start"

MySQL - Solution to the error "mysql deamon failed to start"

黄舟
黄舟Original
2017-01-21 13:17:411286browse

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 (www.php.cn)!


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn