错误日志:
[[email protected] scripts]# tail /var/log/mysqld.log InnoDB: Apply batch completed 2014-12-08 11:01:37 15721 [Note] InnoDB: 128 rollback segment(s) are active. 2014-12-08 11:01:37 15721 [Note] InnoDB: Waiting for purge to start 2014-12-08 11:01:37 15721 [Note] InnoDB: 5.6.12 started; log sequence number 1600607 2014-12-08 11:01:37 15721 [Note] Server hostname (bind-address): ‘*‘; port: 3306 2014-12-08 11:01:37 15721 [Note] IPv6 is available. 2014-12-08 11:01:37 15721 [Note] - ‘::‘ resolves to ‘::‘; 2014-12-08 11:01:37 15721 [Note] Server socket created on IP: ‘::‘. 2014-12-08 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
错误原因:
由于mysql_install_db时指定的datadir路径为/home/tools/mysql/data,而my.cnf为缺省的路径
所以修改/etc/my.cnf路径和他一致就可以了
[[email protected] scripts]# vim /etc/my.cnf
[mysqld]
..........
datadir=/home/tools/mysql/data
socket=/var/lib/mysql/mysql.sock
user=mysql
..........
然后重新mysql_install_db,问题解决
[[email protected] scripts]# /etc/init.d/mysqld start
Starting MySQL.. SUCCESS!
时间: 2024-10-13 23:58:28