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