When MySQL is started, Fatalerror: Can 'topenandlockprivilege is reported.

Source: Internet
Author: User
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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.