Home>Article>Operation and Maintenance> The mysql service failed to start under centos7
Cause analysis:
Open the MySQL alarm log, prompting that the pid file cannot be created, as follows:
Solution:
Create the /var/run/mysqld/ directory and restart the MySQL service.
[root@spark01 ~]# mkdir -p /var/run/mysqld/ [root@spark01 ~]# /etc/init.d/mysqld start
Note: The owner and group of /var/run/mysqld/ are root. Mysql cannot create files in it. You need to modify the owner and group of the directory.
Related tutorial recommendations:centos tutorial
The above is the detailed content of The mysql service failed to start under centos7. For more information, please follow other related articles on the PHP Chinese website!