MySQL 检查需要升级、损坏或未完全关闭的表
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/22884401/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Checking for tables which need an upgrade, are corrupt or were not closed cleanly
提问by user2002692
I am running mysql on my EC2 and when I tried to do: sudo /etc/init.d/mysql restart I got this:
我在 EC2 上运行 mysql,当我尝试执行以下操作时: sudo /etc/init.d/mysql restart 我得到了这个:
- Stopping MySQL database server mysqld
- Starting MySQL database server mysqld
- Checking for tables which need an upgrade, are corrupt or were not closed cleanly.
- 停止 MySQL 数据库服务器 mysqld
- 启动 MySQL 数据库服务器 mysqld
- 检查需要升级、损坏或未完全关闭的表。
Here is what is in my /var/log/mysql/error.log
这是我的 /var/log/mysql/error.log 中的内容
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.
140406 1:47:27 InnoDB: Unable to open the first data file
InnoDB: Error in opening ./ibdata1
140406 1:47:27 InnoDB: Operating system error number 11 in a file operation.
InnoDB: Error number 11 means 'Resource temporarily unavailable'.
InnoDB: Some operating system error numbers are described at
InnoDB: http://dev.mysql.com/doc/refman/5.5/en/operating-system-error-codes.html
140406 1:47:27 InnoDB: Could not open or create data files.
140406 1:47:27 InnoDB: If you tried to add new data files, and it failed here,
140406 1:47:27 InnoDB: you should now edit innodb_data_file_path in my.cnf back
140406 1:47:27 InnoDB: to what it was, and remove the new ibdata files InnoDB created
140406 1:47:27 InnoDB: in this failed attempt. InnoDB only wrote those files full of
140406 1:47:27 InnoDB: zeros, but did not yet use them in any way. But be careful: do not
140406 1:47:27 InnoDB: remove old data files which contain your precious data!
140406 1:47:27 [ERROR] Plugin 'InnoDB' init function returned error.
140406 1:47:27 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
140406 1:47:27 [ERROR] Unknown/unsupported storage engine: InnoDB
140406 1:47:27 [ERROR] Aborting
140406 1:47:27 [Note] /usr/sbin/mysqld: Shutdown complete
140406 01:47:27 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
Could someone please tell me what is going on?
有人可以告诉我这是怎么回事吗?
Thanks
谢谢
回答by Rico
Looks you have a mysql process running. There's a lock on your ./ibdata1file. it could be that for some reason your service mysql stopcommand is not stopping the process as it may not be finding the PIDof your mysql server.
看起来你有一个 mysql 进程正在运行。你的./ibdata1文件被锁定了。可能是由于某种原因,您的service mysql stop命令没有停止进程,因为它可能找不到PID您的 mysql 服务器。
Run from the command line:
从命令行运行:
ps -Af | grep mysql
Get the PID of your mysql process and then simply:
获取 mysql 进程的 PID,然后简单地:
kill -9 <PID of your mysql process>

