[[Email protected] ~]# service mysqld start
Starting MySQL. error! The server quit without updating PID file (/var/lib/mysql/localhost.localdomain.pid).
1. may be/usr/local/mysql/data/rekfan.pid file does not have permission to write
WORKAROUND: Give permission to perform "Chown-r mysql:mysql/usr/local/mysql" "Chmod-r 755/usr/local/mysql/data" restart mysqld try again.
2. The MySQL process may already exist in the process
WORKAROUND: Use the command "Ps-ef|grep mysqld" to see if there is a mysqld process, if you have to kill with "kill-9 process number", restart mysqld try.
3. It may be the second time that MySQL is installed on the machine, with residual data affecting the start of the service.
Workaround: Go to MySQL data directory/data See, if there is mysql-bin.index, quickly delete it, it may be caused by it.
4.mysql The/ETC/MY.CNF profile is used when the configuration file is not specified at startup, please open this file to see if there is a specified data directory (DATADIR) under the [Mysqld] section.
WORKAROUND: Please set these two lines under [mysqld]:
Basedir=/usr/local/mysql
Datadir=/usr/local/mysql/data
5.skip-federated Field Issues
Workaround: Check the/etc/my.cnf file for any skip-federated fields that have not been commented out, and if so, comment them out immediately.
6. Error log directory does not exist
Workaround: Use "Chown" "chmod" command to give MySQL owner and permissions
# Chown-r mysql.mysql/usr/local/mysql/
# Chmod-r 755/usr/local/mysql/data
# Chown-r Mysql.mysql/var/log/mysql-r
# Chown-r Mysql.mysql/var/lib/mysql-r
7.selinux, if it is a CentOS system, the default is to turn on SELinux
Workaround: Turn it off, open the/etc/selinux/config, change the selinux=enforcing to selinux=disabled, and then save the restart machine and try again.
Linux mysql Error: mysql:the server quit without updating PID file