MySQL: Starting MySQL….. ERROR! The server quit without updating PID file

Some time ago, a database image was packaged, but an error was found after starting the container······

MySQL: Starting MySQL….. ERROR! The server quit without updating PID file

Checked the solution on the network is more complete, then transfer note

Because the image has been a master-slave before packaging, this time, the MySQL in the data directory/data is saved_ Just rename the ms.index file and restart the build

-rw-rw---- 1 mysql mysql       36 Dec 16 01:43 mysql_MS.index
-rw-rw---- 1 mysql mysql      126 Dec 16 01:35 mysql_MS.index.bak

There are many possible reasons for this situation. The best way is to check the error log first

1. Maybe the/usr/local/MySQL/data/mysql.pid file has no write permission
solution: give permission and execute “chown – R” mysql:mysql /var/data ””Chmod – R 755/usr/local/MySQL/data” and restart mysqld< 2. There may be MySQL process in the process
solution: use the command “PS – EF | grep mysqld” to check whether there is a mysqld process, if there is, use “kill – 9 process number” to kill it, and then restart mysqld

3. It may be the second time that MySQL is installed on the machine, and some residual data affects the service startup
solution: go to the data directory/data of MySQL. If there is mysql-bin.index, delete it as soon as possible. It is the culprit

4. When MySQL does not specify a configuration file, it will use the/etc/my.cnf configuration file. Please open this file to see if there is a specified data directory (dataDir) under the [mysqld] section<
solution: please set this line under [mysqld]: dataDir =/usr/local/MySQL/data

5. Skip federated field problem
solution: check the/etc/my.cnf file to see if there are any skip federated fields that have not been commented out. If so, comment them out immediately< 6. The error log directory does not exist
solution: use “chown” “Chmod” command to give MySQL owner and permission

7. The trouble caused by SELinux, if it is CentOS system, SELinux will be turned on by default
solution: turn it off, open/etc/SELinux/config, Change SELinux = forcing to SELinux = disabled, save the disk, exit and restart the machine

References

1. MySQL prompt: the server quit without updating PID file

Similar Posts: