mysql error 11_mysqld报InnoDB: Unable to lock ./ibdata1 error: 11

mysql崩溃后进行重启

[root@mysql22-back ~]# service mysqld restart

Stopping mysqld: [ OK ]

Timeout error occurred trying to start MySQL Daemon.

Starting mysqld: [FAILED]

查看mysqld状态

[root@mysql22-back ~]# service mysqld status

mysqld dead but subsys locked

查看日志

tailf -20 /var/log/mysqld.log

2019-02-21T05:42:34.839336Z 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11

2019-02-21T05:42:34.839417Z 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files.

2019-02-21T05:42:34.839443Z 0 [Note] InnoDB: Unable to open the first data file

2019-02-21T05:42:34.839500Z 0 [ERROR] InnoDB: Operating system error number 11 in a file operation.

2019-02-21T05:42:34.839588Z 0 [ERROR] InnoDB: Error number 11 means 'Resource temporarily unavailable'

2019-02-21T05:42:34.839623Z 0 [Note] InnoDB: Some operating system error numbers are described at http://dev.mysql.com/doc/refman/5.7/en/operating-system-error-codes.html

2019-02-21T05:42:34.839649Z 0 [ERROR] InnoDB: Cannot open datafile './ibdata1'

2019-02-21T05:42:34.839679Z 0 [ERROR] InnoDB: Could not open or create the system tablespace. If you tried to add new data files to the system tablespace, and it failed here, you should now edit innodb_data_file_path in my.cnf back to what it was, and remove the new ibdata files InnoDB created in this failed attempt. InnoDB only wrote those files full of zeros, but did not yet use them in any way. But be careful: do not remove old data files which contain your precious data!

2019-02-21T05:42:34.839704Z 0 [ERROR] InnoDB: Plugin initialization aborted with error Cannot open a file

2019-02-21T05:42:35.140042Z 0 [ERROR] Plugin 'InnoDB' init function returned error.

2019-02-21T05:42:35.140134Z 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.

2019-02-21T05:42:35.140162Z 0 [ERROR] Failed to initialize builtin plugins.

2019-02-21T05:42:35.140182Z 0 [ERROR] Aborting

尝试解决

杀死mysql进程

kill -9 mysql进程

移动文件

mv ibdata1 ibdata1.bak

mv ib_logfile0 ib_logfile0.bak

mv ib_logfile1 ib_logfile1.bak

cp -a ibdata1.bak ibdata1

cp -a ib_logfile0.bak ib_logfile0

cp -a ib_logfile1.bak ib_logfile1

进行重启

[root@mysql22-back ~]# service mysqld restart

Stopping mysqld: [ OK ]

Timeout error occurred trying to start MySQL Daemon.

Starting mysqld: [FAILED]

再次查看日志

2019-02-21T06:24:52.584363Z 0 [Note] InnoDB: Highest supported file format is Barracuda.

2019-02-21T06:24:52.711484Z 0 [Note] InnoDB: Log scan progressed past the checkpoint lsn 210507159097

2019-02-21T06:24:52.711571Z 0 [Note] InnoDB: Doing recovery: scanned up to log sequence number 210507159106

2019-02-21T06:24:52.711599Z 0 [Note] InnoDB: Database was not shutdown normally!

2019-02-21T06:24:52.711617Z 0 [Note] InnoDB: Starting crash recovery.

日志显示正在恢复,进行等待即可

[root@mysql22-back ~]# service mysqld status

mysqld (pid 11178) is running...

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值