一次重启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解决方法的更多相关文章

  1. [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' ...

  2. [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 ...

  3. 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 ...

  4. Mysql报错Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist

    安装mysql后,启动时候没有启动成功,查看了下日志报错如下:---------------------------------------------1   可以:初始化mysql:mysql_in ...

  5. 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 ...

  6. 【转】安装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 -- ...

  7. 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 这时候可以执行脚本 ...

  8. [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 ...

  9. 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 倒入一个从其 ...

随机推荐

  1. 【jdk源码3】HashMap源码学习

    可以毫不夸张的说,HashMap是容器类中用的最频繁的一个,而Java也对它进行优化,在jdk1.7及以前,当将相同Hash值的对象以key的身份放到HashMap中,HashMap的性能将由O(1) ...

  2. springboot 学习之路 17(webflux 入门 (1))

    Webflux: webflux是在springboot2系列引入的技术:补充一些概念: 1> Reactive Streams 是 JVM 中面向流的库标准和规范: 处理可能无限数量的元素 按 ...

  3. nodejs设置NODE_ENV环境变量(1)

    看下app.js文件中的一部分代码,如下: //开发环境错误处理 // will print stacktrace if (app.get('env') === 'development') { ap ...

  4. 【three.js练习程序】创建简单物理地形

    <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title> ...

  5. 重学C语言---03数据和C

    1.数据的必要性.数据使我们生活中不可缺少的东西,程序也是如次,离不开数据.将文字.图片和单词等输入到算计,将其展现出来或者做一系列操作等. 2.实例程序. /*rhodium.c--用金属铑衡量体重 ...

  6. ORACLE-SQL微妙之处

    本文总结一下平时经常使用的SQL语句以及一些ORACLE函数的微妙之处.欢迎大家多多补充平时最常用的SQL语句,供大家学习参考. SQL> select * from temp2; NAME S ...

  7. 做为一个.net码农,打开公司的一个项目,大叔我哭了

    先说下背景,楼主在上海,之前一直是做BS互联网开发的,今年进入这家公司,是做软件产品的小外企. 然后,啥也不说了,直接上图吧: 因为一个屏幕没有办法显示出来,所以我截了3张图,然后拼成一张,这还是我花 ...

  8. Java语言的主要特点

    Java语言有很多的优点,可靠.安全.编译和解释型语言.分布式.多线程.完全面向对象.与平台无关性等等. 与平台无关性 Java语言最大的优势在于与平台无关性,也就是可以跨平台使用. 绝大多数的编程语 ...

  9. skimage 安装和子模块

    平台:Windows 10 1.安装anaconda anaconda是python环境的集成安装软件,建议安装2.7版本的python 2.安装skimage 打开windows的命令提示符:  输 ...

  10. [Eclipse]在重命令文件名时,提示编码格式有问题导致修改失败,需要设置如下几个默认编码为UTF-8

    需要设置的几处地方为: 1.Window->Preferences->General ->Content Type->Text->JSP 最下面设置为UTF-8 2. W ...