[ERROR] Fatal Error:can ' t open and Lock Privilege tables:table ' mysql.user ' doesn ' t exist

Source: Internet
Author: User

This problem is due to the fact that the database table is not installed in the data directory

Workaround:

Vi/etc/my.cnf

Modify the correct datadir= "xxxxx" to

Then service mysqld start

Service MySQL Start

After normal startup, you will/var/lib/mysql the following generated Mysql.sock file,

Then also reported: ERROR 2002 (HY000): Can ' t connect to local MySQL server through socket '/tmp/mysql.sock '

You can specify the Mysql.sock path:

Mysql-u root-p-s/var/lib/mysql/mysql.sock

There are sometimes problems with your directory permissions:

Remember to assign permissions: Chown-r mysql:mysql/usr/local/mysql

The above is transferred from http://blog.csdn.net/ec06cumt/article/details/50778240

I checked the data file without the database file, which is the "database table is not installed because of the data directory."

But my problem is that the database on the server was hacked and all the data was erased (including MySQL's own database), so my solution: 1. Copy a system data file in the past; 2. Reload MySQL.

So I copied my local mysql,performance_schema,test three folder to the server's data folder to restart my Phpstudy (my is an integrated environment). OK Problem Solving

[ERROR] Fatal Error:can ' t open and Lock Privilege tables:table ' mysql.user ' doesn ' t exist

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.