Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist
2016-11-05 08:34
537 查看
[root@localhost download]# service mysqld start
Redirecting to /bin/systemctl start mysqld.service
Job for mysqld.service failed because a timeout was exceeded. See "systemctl status mysqld.service" and "journalctl -xe" for details.
解决了一个安装包的问题,然后安装后mysql起不来啊
more /etc/my.cnf |grep -v ^#
[root@localhost ~]#more /etc/my.cnf |grep -v ^#
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
symbolic-links=0
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
配置看起来都正常
systemctl status -l mysqld找了错误日志/var/log/mysqld.log
CGroup: /system.slice/mysqld.service
├─5472 /bin/sh /usr/bin/mysqld_safe
└─5638 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib64/mysql/plugin --log-error=/var/log/mysqld.log --pid-file=/var/run/mysqld/mysqld.pid --socket=/var/lib/mysql/mysql.sock
Nov 04 17:21:49 localhost.localdomain systemd[1]: mysqld.service holdoff time over, scheduling restart.
Nov 04 17:21:49 localhost.localdomain systemd[1]: Starting MySQL Community Server...
Nov 04 17:21:49 localhost.localdomain mysqld_safe[5472]: 161104 17:21:49 mysqld_safe Logging to '/var/log/mysqld.log'.
Nov 04 17:21:50 localhost.localdomain mysqld_safe[5472]: 161104 17:21:50 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
Nov 04 17:21:50 localhost.localdomain systemd[1]: Started MySQL Community Server.
tail 下日志然后搜索了下这个错误
Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist
使用脚本初始化数据库,无效scripts/mysql_install_db --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --user=mysql --ldata=/var/lib/mysql
权限不足,然后加了2个目录的权限
chown -R mysql /var/lib/mysql
chgrp -R mysql /var/lib/mysql
终于进来了
[root@localhost ~]# mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.6.34 MySQL Community Server (GPL)
Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
相关文章推荐
- Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist
- Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist的解决方法
- mysql提示Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist解决方法
- Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist的解决方法
- [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn't exist 160913 02:11:21 mysqld_safe mysqld from pid file /tmp/mysql.pid ended
- Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist的解决方法
- Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist的解决方法
- Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist的解决方法 .
- 启动mysql问题Can't open and lock privilege tables: Table 'mysql.host' doesn't exist
- fatal error:can't open and lock privilege tables:table 'mysql.host' doesn't exist
- mysql启动报错:Table 'mysql.host' doesn't exist
- Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist
- Table 'barfoo_datacenter_config.parttemplates' doesn't exist------Mysql
- 【转】安装mysql 出现:Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn't exist
- C# 连接远程MySql出错,显示表不存在 [ C# | MySql | Table 'TABLENAME' doesn't exist ]
- mysql执行语句提示Table 'performance_schema.session_variables' doesn't exist
- Fatal error: Can’t open and lock privilege tables: Table ‘mysql.host’ doesn’t exist
- 安装mysql 出现:Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn't exist
- Linux环境下MySQL报Table 'xxx' doesn't exist错误解决方法
- Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn't exist解决办法