/文章

InnoDB: Unable to lock ./ibdata1, error: 11 解决方法

错误日志中: InnoDB: Unable to lock ./ibdata1, error: 11

二进制日志中: Error writing file '/tmp/tmp....' (Errcode: 28)

今天在看本地测试环境的时候发现主备数据库中备用的数据库在读取的时候出现错误了,读取不到需要的内容,但是切换到主数据库就可以了,无奈....

进入备用的数据库一看,我去....   竟然刚建的表没有建立成功,什么情况...

先把数据库关了,重启一下试试....

关闭之后,再启动竟然启动不了了,一直处于正在启动中,一直显示.....  这可怎么搞也,我又不是专业的.

看看错误日志吧,看看能不能找到一些问题所在.

果然不出我所料,在错误日志中,启动的时候出现大量的信息,主要信息就只有一个.

InnoDB: Unable to lock ./ibdata1, error: 11
InnoDB: Check that you do not already have another mysqld process
InnoDB: using the same InnoDB data or log files.
InnoDB: Unable to lock ./ibdata1, error: 11
InnoDB: Check that you do not already have another mysqld process
InnoDB: using the same InnoDB data or log files.
InnoDB: Unable to lock ./ibdata1, error: 11
InnoDB: Check that you do not already have another mysqld process
InnoDB: using the same InnoDB data or log files.
InnoDB: Unable to lock ./ibdata1, error: 11
InnoDB: Check that you do not already have another mysqld process
InnoDB: using the same InnoDB data or log files.
InnoDB: Unable to lock ./ibdata1, error: 11
InnoDB: Check that you do not already have another mysqld process
InnoDB: using the same InnoDB data or log files.
InnoDB: Unable to lock ./ibdata1, error: 11
InnoDB: Check that you do not already have another mysqld process
InnoDB: using the same InnoDB data or log files.
InnoDB: Unable to lock ./ibdata1, error: 11
InnoDB: Check that you do not already have another mysqld process
InnoDB: using the same InnoDB data or log files.
InnoDB: Unable to lock ./ibdata1, error: 11
InnoDB: Check that you do not already have another mysqld process
InnoDB: using the same InnoDB data or log files.
InnoDB: Unable to lock ./ibdata1, error: 11
InnoDB: Check that you do not already have another mysqld process
InnoDB: using the same InnoDB data or log files.
InnoDB: Unable to lock ./ibdata1, error: 11
InnoDB: Check that you do not already have another mysqld process
InnoDB: using the same InnoDB data or log files.
InnoDB: Unable to lock ./ibdata1, error: 11
InnoDB: Check that you do not already have another mysqld process
InnoDB: using the same InnoDB data or log files.
InnoDB: Unable to lock ./ibdata1, error: 11
InnoDB: Check that you do not already have another mysqld process
InnoDB: using the same InnoDB data or log files.
InnoDB: Unable to lock ./ibdata1, error: 11
InnoDB: Check that you do not already have another mysqld process
InnoDB: using the same InnoDB data or log files.
InnoDB: Unable to lock ./ibdata1, error: 11
InnoDB: Check that you do not already have another mysqld process
InnoDB: using the same InnoDB data or log files.
InnoDB: Unable to lock ./ibdata1, error: 11
InnoDB: Check that you do not already have another mysqld process
InnoDB: using the same InnoDB data or log files.
InnoDB: Unable to lock ./ibdata1, error: 11
InnoDB: Check that you do not already have another mysqld process
InnoDB: using the same InnoDB data or log files.
InnoDB: Unable to lock ./ibdata1, error: 11
InnoDB: Check that you do not already have another mysqld process

 

InnoDB: Unable to lock ./ibdata1, error: 11

直接把这个错误信息弄到百度上,找到原因了,感谢度娘

 

要是你开启了二进制日志功能那么你会看见里边有

" Error writing file '/tmp/tmp....' (Errcode: 28)"类似的内容,也是同样的原因造成的.

 

错误原因:

此错误信息是由于你的磁盘空间不足导致在mysql启动的时候无法正常的读写你data中的表的数据

 

用df -Th就能看见你现在的空间使用量了.

可以使用du -sh /*  来看一下那个路径下的文件比较大,删除一些无用的文件就好了.

 

PS:有时也不一定是空间不做造成的,不过你可以这样做

mysql进程图片

 

用kill -9 将这两个进程杀死.

然后用命令重新启动mysqld服务

service mysqld start

 

本文固定链接:http://www.bbtang.info/database/mysql/336.html 原文链接:InnoDB: Unable to lock ./ibdata1, error: 11 解决方法,转发请注明来源!
11 27

发表评论