Today, I opened another MySQL on the server. I created a new configuration file and modified the port. After the directory is stored, the service will not be able to get started. I found the error line Fatalerror: Cantopenandlockprivilegetables: Tablemysql. hostdoesntexist checks the data directory and finds that the mysql directory is not created. manually execute the script
Today, I opened another MySQL on the server, and created a new configuration file to modify the port. After the directory is stored, the service will not be able to get started. The error log shows the error line Fatal error: can't open and lock privilege tables: Table 'mysql. host 'doesn' t exist check the data directory and find that the mysql directory is not created. manually execute the script
Open another MySQL on the server today, create a new configuration file and modify the port. After the directory is stored, the service will not start. Check the error log to find the error line.
Fatal error: Can't open and lock privilege tables: Table 'mysql. host' doesn' t exist
Check the data directory. If the mysql directory is not created, manually execute the script.
Mysql_install_db -- usrer = mysql -- datadir =/var/lib/mysql/newdata
Set the directory permission manually.
Chown mysql. mysql/var/lib/mysql/newdata-R
Restart the MySQL service and run normally.
Original article address: Start MySQL to report Fatal error: Can't open and lock privilege. Thank you for sharing it with me.