MySQL [ERROR] Table & #39; mysql. user & #39; doesn & #39; t exist, mysql. userexist

Source: Internet
Author: User

MySQL [ERROR] Table 'mysql. user' doesn' t exist, mysql. userexist

A newly installed mysql source code, because the my-default.cnf was not copied to the/etc/my. cnf location, when starting mysql encountered an error that could not open the mysql. user table. Specific ERROR: [error] Fatal ERROR: Can't open and lock privilege tables: Table 'mysql. user' doesn' t exist. The following describes the error and its solution.

 

1. symptom description
[Root @ HKBO scripts] # service mysqld start
Starting MySQL .. The server quit without updating PID file (/var/lib/mysql/HKBO. pid). [FAILED]

# Viewing error logs
[Root @ HKBO scripts] # tail/var/log/mysqld. log
InnoDB: Apply batch completed
11:01:37 15721 [Note] InnoDB: 128 rollback segment (s) are active.
11:01:37 15721 [Note] InnoDB: Waiting for purge to start
11:01:37 15721 [Note] InnoDB: 5.6.12 started; log sequence number 1600607
11:01:37 15721 [Note] Server hostname (bind-address): '*'; port: 3306
11:01:37 15721 [Note] IPv6 is available.
11:01:37 15721 [Note]-': 'resolves '::';
11:01:37 15721 [Note] Server socket created on IP :'::'.
11:01:37 15721 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql. user' doesn' t exist
141208 11:01:37 mysqld_safe mysqld from pid file/var/lib/mysql/HKBO. pid ended

# Author: Leshami
# Blog: http://blog.csdn.net/leshami

 

2. Solution
# View the current my. cnf configuration file
[Root @ HKBO scripts] # more/etc/my. cnf | grep-v ^ #
[Mysqld]
Datadir =/var/lib/mysql
Socket =/var/lib/mysql. sock
User = mysql
Old_passwords = 1

[Mysqld_safe]
Log-error =/var/log/mysqld. log
Pid-file =/var/run/mysqld. pid

# Because the path specified during compilation and installation is/opt/data and the datadir specified during mysql_install_db is also/opt/data, and my. cnf is the default path
# Solve the problem after modifying datadir to the correct path
[Root @ HKBO scripts] # vi/etc/my. cnf
[Root @ HKBO support-files] # more/etc/my. cnf | grep datadir
Datadir =/opt/data

[Root @ HKBO support-files] # service mysqld start
Starting MySQL. [OK]

 

3. More references
Install the full version of MySQL source code in Linux
Considerations for installing MySQL source code scr. rpm
Install MySQL 5.6 in Linux 5 (RPM Mode)
Uninstall MySQL 5 in Linux

Related Article

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.