[Solved] Starting MySQL… ERROR The server quit without updating PID file

An error is reported when starting MySQL after the Linux server is restarted. The error information is as follows:

Starting MySQL… ERROR! The server quit without updating PID file (/usr/local/mysql/data/VM_0_9_centos.pid).

Solution:

1. Modify the MySQL configuration file in/etc/my cnf。 Add the following configuration:

basedir = /usr/local/mysql
datadir = /usr/local/mysql/data
log-error = /usr/local/mysql/error.log
pid-file = /usr/local/mysql/mysql.pid
user = mysql
tmpdir = /tmp

2. Initialize and execute some commands in/usr/local/MySQL/scripts:

./mysql_install_db --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --pid-file=/usr/local/mysql/data/mysql.pid --tmpdir=/tmp

This database can be started normally.

However, due to the reinitialization of the database, you will be prompted that you do not have permission when accessing the previous database.

Two commands are required:

chown -R mysql:mysql /usr/local/mysql/
chmod -R 755 /usr/local/mysql/

Tip: the directories here are all my real MySQL installation directories. The directories installed by each person may be different.

Read More: