mysql启动报错(kill后)解决记录

症状:

[root@centos6 mysqlApp]# service mysqld restart
MySQL server PID file could not be found!                  [失败]
Starting MySQL..The server quit without updating PID file ([失败]ib/mysql/centos6.5-2.pid).

以上症状是执行完:kill -9  ***** ,强制杀死mysql进程后导致,启动失败,

解决步骤:1.查看mysql 启动日志:

161125 13:19:33 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
/home/mysql/mysqlApp/bin/mysqld: Table 'mysql.plugin' doesn't exist
161125 13:19:33 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
161125 13:19:33 InnoDB: The InnoDB memory heap is disabled
161125 13:19:33 InnoDB: Mutexes and rw_locks use GCC atomic builtins
161125 13:19:33 InnoDB: Compressed tables use zlib 1.2.3
161125 13:19:33 InnoDB: Initializing buffer pool, size = 128.0M
161125 13:19:33 InnoDB: Completed initialization of buffer pool
161125 13:19:33 InnoDB: highest supported file format is Barracuda.
161125 13:19:33  InnoDB: Waiting for the background threads to start
161125 13:19:34 InnoDB: 1.1.8 started; log sequence number 1595675
161125 13:19:34 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist
161125 13:19:34 mysqld_safe mysqld from pid file /var/lib/mysql/centos6.5-2.pid ended
161125 13:25:00 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
/home/mysql/mysqlApp/bin/mysqld: Table 'mysql.plugin' doesn't exist
161125 13:25:00 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.


查看log,发现mysql系统表丢失了,因为数据库数据都是测试数据,重建数据库不影响。

2. 执行创建表的初始化脚本:

进入mysqld所在目录:cd    /home/mysql/mysqlApp/

执行:#./scripts/mysql_install_db --user=mysql --datadir=/var/lib/mysql

[root@centos6 mysqlApp]# ./scripts/mysql_install_db --user=mysql --datadir=/var/lib/mysql
WARNING: The host 'centos6.5-2' could not be looked up with resolveip.
This probably means that your libc libraries are not 100 % compatible
with this binary MySQL version. The MySQL daemon, mysqld, should work
normally with the exception that host name resolving will not work.
This means that you should use IP addresses instead of hostnames
when specifying MySQL privileges !
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:

3.再次执行启动脚本:

[root@centos6 mysqlApp]# service mysqld restart
MySQL server PID file could not be found!                  [失败]
Starting MySQL..                                           [确定]
[root@centos6 mysqlApp]# lsof -i:3306
COMMAND  PID  USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
mysqld  4178 mysql   10u  IPv4  29602      0t0  TCP *:mysql (LISTEN)

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值