Tag Archives: Can’t open and lock privilege tables: Table ‘mysql.user’ doesn’t exist

Can’t open and lock privilege tables: Table ‘mysql.user’ doesn’t exist

Front end developers must read! Starting from scratch, teach you to build a low code website platform in stages>>>

Today, after logging into the alicloud account, I found that there was a warning on the server that there was a vulnerability. After the repair, I had to restart the server. I didn’t even think about it

Next thing happened, just want to restart MySQL directly

Description of the phenomenon[ root@iZwz952coo41my3i5b7x2iZ ]# service mysqld start
Starting MySQL..The server quit without updating PID file (/usr/local/mysql/data/mysql/iZwz952coo41my3i5b7x2iZ.pid).[FAILED]

Failed to start the database. Then go to the file izwz952coo41my3i5b7x2iz.err and find the following line:

Solution:

# view the/etc/my.cnf configuration file

Because the path specified when compiling and installing MySQL is/usr/local/MySQL and mysql_ install_ DB, the specified dataDir is also/usr/local/MySQL, and my.cnf is the default path
# therefore, after modifying dataDir to the correct path, the problem is solved

[ root@iZwz952coo41my3i5b7x2iZ ]# service mysqld start
     Starting MySQL.[ OK ]