mysql提示Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist解决方法
一次重启mysql发现无法启动成功,通过检查mysql日志发现问题并解决了问题。 mysql启动失败的日志:
[root@nn ~]# tail -n 20 /var/log/mysqld.log
130924 10:14:54 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist
130924 10:14:54 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
130924 10:27:09 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
/usr/libexec/mysqld: Table 'mysql.plugin' doesn't exist
130924 10:27:09 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
130924 10:27:09 InnoDB: Initializing buffer pool, size = 8.0M
130924 10:27:09 InnoDB: Completed initialization of buffer pool
InnoDB: Log scan progressed past the checkpoint lsn 0 37356
130924 10:27:09 InnoDB: Database was not shut down normally!
InnoDB: Starting crash recovery.
InnoDB: Reading tablespace information from the .ibd files...
InnoDB: Restoring possible half-written data pages from the doublewrite
InnoDB: buffer...
InnoDB: Doing recovery: scanned up to log sequence number 0 44233
130924 10:27:09 InnoDB: Starting an apply batch of log records to the database...
InnoDB: Progress in percents: 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99
InnoDB: Apply batch completed
130924 10:27:10 InnoDB: Started; log sequence number 0 44233
130924 10:27:10 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist
130924 10:27:10 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
解决方法:运行mysql_install_db --user=mysql --ldata=/var/lib/mysql/,运行结果如下,问题解决:
[root@nn ~]# mysql_install_db --user=mysql --ldata=/var/lib/mysql/
Installing MySQL system tables...
OK
Filling help tables...
OK To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands: /usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h hostbus.net password 'new-password' Alternatively you can run:
/usr/bin/mysql_secure_installation which will also give you the option of removing the test
databases and anonymous user created by default. This is
strongly recommended for production servers. See the manual for more instructions. You can start the MySQL daemon with:
cd /usr ; /usr/bin/mysqld_safe & You can test the MySQL daemon with mysql-test-run.pl
cd /usr/mysql-test ; perl mysql-test-run.pl Please report any problems with the /usr/bin/mysqlbug script! [root@nn ~]#
[root@nn ~]# service mysqld start
Starting mysqld: [ OK ]
mysql提示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.host' doesn't exist
mysql 启动总是报错: 错误日志中显示: [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.host' ...
- [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
-- :: [Note] InnoDB: Renaming log file ./ib_logfile101 to ./ib_logfile0 -- :: [Warning] InnoDB: New ...
- mysql [ERROR] 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 2013-11-2 ...
- Mysql报错Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist
安装mysql后,启动时候没有启动成功,查看了下日志报错如下:---------------------------------------------1 可以:初始化mysql:mysql_in ...
- Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist
今天在用一键安装mysql的shell脚本安装mysql-5.1.73软件后发现mysql始终无法启动,多次执行后依旧报错,只能去查看error日志,发现了如下的2个错误: 错误一:Fatal err ...
- 【转】安装mysql 出现:Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn't exist
来源:http://blog.csdn.net/dapeng0112/article/details/37053407 本来初始化配置是这样的: scripts/mysql_install_db -- ...
- mysql启动报错: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 这时候可以执行脚本 ...
- [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn't exist
这个问题是由于data的目录下没有安装数据库表 解决方法: vi /etc/my.cnf 修改为正确的datadir=“xxxxx”即可 然后service mysqld start service ...
- mysql安转过程中出现的问题! Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn't exis
net start mysql启动失败,报错信息如上,因缺少mysql这个库 所以跳过 在my.ini中添加 --skip-grant-tables 再启动mysql 然后进入mysql 倒入一个从其 ...
随机推荐
- python turtle 例子 海归绘图
太阳花 1 # coding=utf-8 2 import turtle 3 import time 4 5 # 同时设置pencolor="red", fillc ...
- Oracle EBS AR 客户API
------------------------------------ 1. Set Environment ------------------------------------ -- 1a. ...
- Linux内存寻址之分段机制及分页机制【转】
前言 本文涉及的硬件平台是X86,如果是其他平台的话,如ARM,是会使用到MMU,但是没有使用到分段机制: 最近在学习Linux内核,读到<深入理解Linux内核>的内存寻址一章.原本以为 ...
- 1.2环境的准备(二)之Pycharm的安装和使用
目录: 1.Pycharm的安装 2.Pycharm的使用 (一)pycharm的安装: (1)官网下载:(分为两个版本,专业版和社区版,社区版就足够我们学习用的)https://www.jetbra ...
- NetworkX 图网络处理工具包
简单介绍 NetworkX is a Python package for the creation, manipulation, and study of the structure, dynami ...
- openlayer3 基础学习一创建&显示地图
<!doctype html> <html lang="en"> <head> <link rel="stylesheet&qu ...
- 【Alpha 冲刺】 11/12
今日任务总结 人员 今日原定任务 完成情况 遇到问题 贡献值 胡武成 完成app端api编写 未完成 文件上传api还没完成 孙浩楷 1. 与后端交接, 2. 完成图片在线编辑插件引入 未完成 陷入僵 ...
- Python接口自动化--requests 1
# _*_ encoding:utf-8 _*_ import requests #请求博客园首页,无参数的get请求 r = requests.get('http://www.cnblogs.com ...
- 基于汇编的 C/C++ 协程 - 切换上下文
在前一篇文章<基于汇编的 C/C++ 协程 - 背景知识>中提到一个用于 C/C++ 的协程所需要实现的两大功能: 协程调度 上下文切换 其中调度,其实在技术实现上与其他的线程.进程调度没 ...
- unity3D iTween的使用
iTween是一个动画库,作者创建它的目的就是最小的投入实现最大的产出.让你做开发更轻松,用它能够轻松实现各种动画,晃动,旋转,移动,褪色,上色,控制音频等等 到官网看看 http://itwe ...