启动 MySQL 时出现错误“插件‘InnoDB’注册为存储引擎失败”
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/26439742/
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
Getting error "Plugin 'InnoDB' registration as a STORAGE ENGINE failed" when starting MySQL
提问by Ritesh Kumar
I found many similar question on Stackoverflow but didn't get the exact error solution. My issue is when starting MySQL service on one of the Dedicated Centos 6.5 machine, I am getting error :
我在 Stackoverflow 上发现了很多类似的问题,但没有得到确切的错误解决方案。我的问题是在一台专用 Centos 6.5 机器上启动 MySQL 服务时,出现错误:
141018 05:13:46 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
141018 5:13:47 [Warning] Can't create test file /var/lib/mysql/ip-184-168-73-83.lower-test
141018 5:13:47 [Warning] Can't create test file /var/lib/mysql/ip-184-168-73-83.lower-test
/usr/libexec/mysqld: Can't create/write to file '/tmp/ibkTWnhE' (Errcode: 28)
141018 5:13:48 InnoDB: Error: unable to create temporary file; errno: 28
141018 5:13:48 [ERROR] Plugin 'InnoDB' init function returned error.
141018 5:13:48 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
141018 5:13:48 [ERROR] Can't start server : Bind on unix socket: No space left on device
141018 5:13:48 [ERROR] Do you already have another mysqld server running on socket: /var/lib/mysql/mysql.sock ?
141018 5:13:48 [ERROR] Aborting
141018 5:13:48 [Note] /usr/libexec/mysqld: Shutdown complete
141018 05:13:48 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
Here are free command status: free -m
以下是免费命令状态:free -m
total used free shared buffers cached
Mem: 3743 3631 111 0 2705 21
-/+ buffers/cache: 905 2838
Swap: 2047 0 2047
回答by xuri
I have the same problems, this my solution:
我有同样的问题,这是我的解决方案:
Add more RAM to the server
Decrease the value of innodb-buffer-pool size in the config file
/etc/mysql/my.cnf
:innodb_buffer_pool_size = 10M
向服务器添加更多 RAM
减少配置文件中 innodb-buffer-pool size 的值
/etc/mysql/my.cnf
:innodb_buffer_pool_size = 10M
After save my.cnf
, restart mysql service.
保存my.cnf
后重启mysql服务。
回答by Avinash Thombre
This is frequently occurred issue. Do following -
这是经常出现的问题。做以下-
- delete/move out these "aria_log_contro, ib_logfile0, ib_logfile1, ib_data1" files from location "..\xampp\mysql\data" and also from "..\xampp\mysql\backup".
- stop and start apache server and mysql form xampp control panel
- 从位置“..\xampp\mysql\data”和“..\xampp\mysql\backup”删除/移出这些“aria_log_contro、ib_logfile0、ib_logfile1、ib_data1”文件。
- 停止和启动 apache 服务器和 mysql 表单 xampp 控制面板
This should fix the issue; actually it worked for me.
这应该可以解决问题;实际上它对我有用。
回答by Ritesh Kumar
Although late but putting answer here so that solution that helped me can help someone. I took following steps:
虽然晚了但是把答案放在这里,这样帮助我的解决方案可以帮助别人。我采取了以下步骤:
- Added more RAM to sever
- Decrease the value of innodb-buffer-pool size
- Set innodb_log_file_size
- Restart mysql
- 增加了更多的内存来切断
- 减小 innodb-buffer-pool size 的值
- 设置 innodb_log_file_size
- 重启mysql
Example of addition to my.cnf:
添加到 my.cnf 的示例:
innodb_buffer_pool_size = 10M
innodb_log_file_size = 1000M
回答by user3871474
I was getting below mysql error log:-
我低于 mysql 错误日志:-
[Note] Plugin 'FEDERATED' is disabled.
InnoDB: The InnoDB memory heap is disabled
InnoDB: Mutexes and rw_locks use GCC atomic builtins
InnoDB: Compressed tables use zlib 1.2.3
InnoDB: Using Linux native AIO
InnoDB: Initializing buffer pool, size = 128.0M
InnoDB: mmap(137363456 bytes) failed; errno 12
InnoDB: Completed initialization of buffer pool
InnoDB: Fatal error: cannot allocate memory for the buffer pool
[ERROR] Plugin 'InnoDB' init function returned error.
[ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
[ERROR] Unknown/unsupported storage engine: InnoDB
[ERROR] Aborting
[Note] /usr/libexec/mysqld: Shutdown complete
I found out there are two solutions which are:-
我发现有两种解决方案是:-
1)Set innodb_log_file_size equal to the actual size of the existing InnoDB log files. To see what size of innoDB log allocated, login mysql and enter following cmd:-
1) 将 innodb_log_file_size 设置为等于现有 InnoDB 日志文件的实际大小。要查看分配的 innoDB 日志大小,请登录 mysql 并输入以下 cmd:-
SHOW GLOBAL VARIABLES LIKE 'innodb_log_file_size';
Expected result example:- 5242880
预期结果示例:- 5242880
After that, insert that value in my.cnf:- vi /etc/my.cnf
之后,将该值插入到 my.cnf 中:- vi /etc/my.cnf
innodb_log_file_size =5242880
2)Rename or move both the ./ib_logfile0 and ./ib_logfile1 files, and then start the MySQL server.This normally will be located at /var/lib/mysql. After start mysql, it create new innoDB log file and restore possible half-written data from the file of .ibd.
2) 重命名或移动 ./ib_logfile0 和 ./ib_logfile1 文件,然后启动 MySQL 服务器。这通常位于 /var/lib/mysql。启动 mysql 后,它会创建新的 innoDB 日志文件并从 .ibd 文件中恢复可能的半写入数据。
The expexted mysql log example:-
expexted mysql 日志示例:-
InnoDB: Database physically writes the file full: wait...
161216 9:58:54 InnoDB: Log file ./ib_logfile1 did not exist: new to be created
InnoDB: Setting log file ./ib_logfile1 size to 5 MB
InnoDB: Database physically writes the file full: wait...
161216 9:58:54 InnoDB: highest supported file format is Barracuda.
InnoDB: The log sequence number in ibdata files does not match
InnoDB: the log sequence number in the ib_logfiles!
161216 9:58:54 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...
161216 9:58:54 InnoDB: Waiting for the background threads to start
161216 9:58:55 InnoDB: 5.5.50 started; log sequence number 1589772
161216 9:58:55 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306
161216 9:58:55 [Note] - '0.0.0.0' resolves to '0.0.0.0';
161216 9:58:55 [Note] Server socket created on IP: '0.0.0.0'.
161216 9:58:55 [Note] Event Scheduler: Loaded 0 events
161216 9:58:55 [Note] /usr/libexec/mysqld: ready for connections.
Version: '5.5.50' socket: '/var/lib/mysql/mysql.sock' port: 3306 MySQL Community Server (GPL) by Remi
References:- JUSTIN KULESZA (2011). MySQL: Failed Registration of InnoDB as a Storage Engine. Available at: https://spin.atomicobject.com/2011/05/09/mysql-failed-registration-of-innodb-as-a-storage-engine/.
参考资料:-贾斯汀·库莱斯扎 (2011)。MySQL:将 InnoDB 注册为存储引擎失败。可在:https: //spin.atomicobject.com/2011/05/09/mysql-failed-registration-of-innodb-as-a-storage-engine/ 获得。
RolandoMySQLDBA (2014). MySQL my.cnf: innodb_log_file_size is missing. Available at: https://dba.stackexchange.com/questions/75688/mysql-my-cnf-innodb-log-file-size-is-missing/158325#158325
RolandoMySQLDBA (2014)。MySQL my.cnf:缺少 innodb_log_file_size。可在:https: //dba.stackexchange.com/questions/75688/mysql-my-cnf-innodb-log-file-size-is-missing/158325#158325
Changing the Number or Size of InnoDB Redo Log Files. Available at: http://dev.mysql.com/doc/refman/5.7/en/innodb-data-log-reconfiguration.html
更改 InnoDB 重做日志文件的数量或大小。可在:http: //dev.mysql.com/doc/refman/5.7/en/innodb-data-log-reconfiguration.html
回答by Minhaj Javed
I fixed this issue by following:
我通过以下方式解决了这个问题:
- Login to server via SSH with root access.
- Navigate to /var/lib/mysql.
- If you see log files like, ib_logfile0 and ib_logfile1, rename or move them to some other folder.
- Stop and start the MySQL service by running
sudo service mysql stop
andsudo service mysql start
- 使用 root 访问权限通过 SSH 登录到服务器。
- 导航到 /var/lib/mysql。
- 如果您看到诸如 ib_logfile0 和 ib_logfile1 之类的日志文件,请将它们重命名或移动到其他文件夹。
- 通过运行
sudo service mysql stop
和启动 MySQL 服务sudo service mysql start
I hope this helps. Thanks
我希望这有帮助。谢谢
回答by Petr Nagy
Changing the values of innodb_buffer_pool_size
and innodb_log_file_size
didn't work for me.
改变的价值观innodb_buffer_pool_size
和innodb_log_file_size
我没有工作。
Moving ib_logfile0
and ib_logfile1
files didn't help either.
移动ib_logfile0
和ib_logfile1
文件也没有帮助。
What didhelp was:
什么做帮助是:
> service mysql stop
Edit my.cfg
and add innodb_force_recovery = 1
编辑my.cfg
和添加innodb_force_recovery = 1
> service mysql start
> service mysql stop
Comment the innodb_force_recovery = 1
line.
注释该innodb_force_recovery = 1
行。
> service mysql start
And voilá. (I should note that I have no idea if this involves any data loss or not)
瞧。(我应该注意,我不知道这是否涉及任何数据丢失)