微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

Can't open and lock privilege tables: Table 'mysql.user' doesn't exist

[root@szq scripts]# service mysqld start
Starting MysqL..The server quit without updating PID file (/var/lib/MysqL/szq.pid).[Failed]

# more  /prosync/MysqL/MysqL/data/szq.err 
查看报错:
160413 04:46:40 MysqLd_safe Starting MysqLd daemon with databases from /prosync/MysqL/MysqL/data
2016-04-13 04:46:40 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2016-04-13 04:46:40 0 [Note] /prosync/MysqL/MysqL/bin/MysqLd (MysqLd 5.6.30) starting as process 29379 ...
2016-04-13 04:46:40 29379 [Note] Plugin 'FEDERATED' is disabled.
/prosync/MysqL/MysqL/bin/MysqLd: Table 'MysqL.plugin' doesn't exist
2016-04-13 04:46:40 29379 [ERROR] Can't open the MysqL.plugin table. Please run MysqL_upgrade to create it.
2016-04-13 04:46:40 29379 [Note] InnoDB: Using atomics to ref count buffer pool pages
2016-04-13 04:46:40 29379 [Note] InnoDB: The InnoDB memory heap is disabled
......
2016-04-13 04:46:41 29379 [Note]   - '::' resolves to '::';
2016-04-13 04:46:41 29379 [Note] Server socket created on IP: '::'.
2016-04-13 04:46:41 29379 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'MysqL.user' doesn't exist
160413 04:46:41 MysqLd_safe MysqLd from pid file /prosync/MysqL/MysqL/data/szq.pid ended
160413 04:49:43 MysqLd_safe Starting MysqLd daemon with databases from /prosync/MysqL/MysqL/data
......
/prosync/MysqL/MysqL/bin/MysqLd: Table 'MysqL.plugin' doesn't exist
2016-04-13 04:49:43 29528 [ERROR] Can't open the MysqL.plugin table. Please run MysqL_upgrade to create it.
2016-04-13 04:49:43 29528 [Note] InnoDB: Using atomics to ref count buffer pool pages
......
2016-04-13 04:49:43 29528 [Note] Server socket created on IP: '::'.
2016-04-13 04:49:43 29528 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'MysqL.user' doesn't exist
160413 04:49:43 MysqLd_safe MysqLd from pid file /prosync/MysqL/MysqL/data/szq.pid ended

解决办法:
#查看当前的my.cnf配置文件
[root@szq scripts]# more /etc/my.cnf |grep -v ^#

[MysqLd]
basedir =/var/lib/MysqL
socket=/var/lib/MysqL/MysqL.sock
user=MysqL
old_passwords=1

[MysqLd_safe]
log-error=/var/log/MysqLd.log
pid-file=/var/run/MysqLd/MysqLd.pid

#由于编译安装时指定的路径为/prosync/MysqL/MysqL/,MysqL_install_db时指定的datadir为/prosync/MysqL/MysqL/data,而my.cnf为缺省的路径
#因此修改datadir至正确路径后,问题解决
[root@szq scripts]# vi /etc/my.cnf
[root@szq support-files]# more /etc/my.cnf |grep datadir
basedir = /prosync/MysqL/MysqL
datadir = /prosync/MysqL/data

[root@szq kdb11]# service MysqL start 
Warning: World-writable config file '/prosync/MysqL/MysqL/my.cnf' is ignored
Starting MysqL. SUCCESS! 

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐