我的MySQL服务器没有启动。当我检查error.log文件时,我发现了这个。你能建议我做什么吗?
151113 6:59:53 [Warning] Using unique option prefix myisam-recover instead of myisam-recover-options is deprecated and will be removed in a future release. Please use the full name instead.
151113 6:59:53 [Note] Plugin 'FEDERATED' is disabled.
151113 6:59:53 InnoDB: The InnoDB memory heap is disabled
151113 6:59:53 InnoDB: Mutexes and rw_locks use GCC atomic builtins
151113 6:59:53 InnoDB: Compressed tables use zlib 1.2.3.4
151113 6:59:53 InnoDB: Initializing buffer pool, size = 128.0M
151113 6:59:53 InnoDB: Completed initialization of buffer pool
InnoDB: Error: checksum mismatch in data file ./ibdata1
151113 6:59:53 InnoDB: Could not open or create data files.
151113 6:59:53 InnoDB: If you tried to add new data files, and it failed here,
151113 6:59:53 InnoDB: you should now edit innodb_data_file_path in my.cnf back
151113 6:59:53 InnoDB: to what it was, and remove the new ibdata files InnoDB created
151113 6:59:53 InnoDB: in this failed attempt. InnoDB only wrote those files full of
151113 6:59:53 InnoDB: zeros, but did not yet use them in any way. But be careful: do not
151113 6:59:53 InnoDB: remove old data files which contain your precious data!
151113 6:59:53 [ERROR] Plugin 'InnoDB' init function returned error.
151113 6:59:53 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
151113 6:59:53 [ERROR] Unknown/unsupported storage engine: InnoDB
151113 6:59:53 [ERROR] Aborting
151113 6:59:53 [Note] /usr/sbin/mysqld: Shutdown complete
答案 0 :(得分:1)
我刚刚拥有这个,最初表现为" mysql respawning too fast" dmesg
日志中的错误。
从reading elsewhere我追溯到你发现的内容,我认为这表明InnoDB的元数据文件存在某种腐败现象。 InnoDB可以确保事务/回滚完整性和主外键完整性。这就是"校验和不匹配"错误警告你。
你不会说你是如何开始使用mysqld的,但也许你在/etc/init.d/mysqld start
或service mysqld start
使用某种变体。请将守护程序显式地作为命令运行:
sudo /usr/sbin/mysqld --innodb_force_recovery 0
并且,只要您知道为什么要这样做,请逐渐增加--innodb_force_recovery
的零值,直到流程开始。
警告: innodb_force_recovery参数确定了mysqld将尝试的强制措施"强制修复" InnoDB存储中的校验和错误。因此,如果你在这里使用较大的数字进行强制修复,你可以使问题变得更糟,或者需要稍后重建索引,因为InnoDB会做越来越多的事情来尝试修复自己。
每次无法使用特定数字重新启动mysqld
,例如2
,您应该在将其增加到3
之前搜索您收到的错误消息,这样您就可以确定自己正在做正确的事情。我不是你可能得到的每一个错误的专家,所以我不能为每一个特殊条件提供反馈:我只是说,小心使用--innodb_force_recovery
!