dy88 发表于 2020-7-3 11:42:29

centos7 core lnmp1.6 MySQL无法启动

前几天使用正常,昨天停电导致服务器停机,启动后MySQL启动失败、

这是usr/local/mysql/var/localhost.err日志
7001018:00:23 Plugin 'FEDERATED' is disabled.
7001018:00:23 InnoDB: The InnoDB memory heap is disabled
7001018:00:23 InnoDB: Mutexes and rw_locks use GCC atomic builtins
7001018:00:23 InnoDB: Compressed tables use zlib 1.2.11
7001018:00:23 InnoDB: Using Linux native AIO
7001018:00:23 InnoDB: Initializing buffer pool, size = 16.0M
7001018:00:24 InnoDB: Completed initialization of buffer pool
7001018:00:24 InnoDB: highest supported file format is Barracuda.
7001018:00:24InnoDB: Waiting for the background threads to start

licess 发表于 2020-7-3 16:22:12

先备份数据库目录
在/etc/my.cnf 里
下面加上innodb_force_recovery=6

启动mysql,看能否正常启动,如果可以启动尝试修复表,再去掉innodb_force_recovery=6 重启看看能否正常

dy88 发表于 2020-7-3 18:11:11

licess 发表于 2020-7-3 16:22
先备份数据库目录
在/etc/my.cnf 里
下面加上innodb_force_recovery=6


还是不行,加上启动失败,去掉也是失败
这是加上的
200703 18:07:26 InnoDB: Could not open or create data files.
200703 18:07:26 InnoDB: If you tried to add new data files, and it failed here,
200703 18:07:26 InnoDB: you should now edit innodb_data_file_path in my.cnf back
200703 18:07:26 InnoDB: to what it was, and remove the new ibdata files InnoDB created
200703 18:07:26 InnoDB: in this failed attempt. InnoDB only wrote those files full of
200703 18:07:26 InnoDB: zeros, but did not yet use them in any way. But be careful: do not
200703 18:07:26 InnoDB: remove old data files which contain your precious data!
200703 18:07:26 Plugin 'InnoDB' init function returned error.
200703 18:07:26 Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
200703 18:07:26 Unknown/unsupported storage engine: InnoDB
200703 18:07:26 Aborting

这是后来去掉的
200703 18:09:40 InnoDB: Could not open or create data files.
200703 18:09:40 InnoDB: If you tried to add new data files, and it failed here,
200703 18:09:40 InnoDB: you should now edit innodb_data_file_path in my.cnf back
200703 18:09:40 InnoDB: to what it was, and remove the new ibdata files InnoDB created
200703 18:09:40 InnoDB: in this failed attempt. InnoDB only wrote those files full of
200703 18:09:40 InnoDB: zeros, but did not yet use them in any way. But be careful: do not
200703 18:09:40 InnoDB: remove old data files which contain your precious data!
200703 18:09:40 Plugin 'InnoDB' init function returned error.
200703 18:09:40 Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
200703 18:09:40 Unknown/unsupported storage engine: InnoDB
200703 18:09:40 Aborting

200703 18:09:40 /usr/local/mysql/bin/mysqld: Shutdown complete

dy88 发表于 2020-7-3 18:23:21

现在好了,删除了ib_logfile0 ib_logfile1 ibdata1后解决

dy88 发表于 2020-7-3 18:32:04

刚刚尝试下,使用myphpadmin进去发现数据库都在也显示有表,但进入查看时显示没有表,typecho直接报Database Query Error,有办法修复吗

dy88 发表于 2020-7-3 18:36:15

这是使用Navicat查看表的截图

licess 发表于 2020-7-4 09:50:52

是否修改了 innodb_data_file_path 参数,没修改应该不报 200703 18:07:26 InnoDB: you should now edit innodb_data_file_path in my.cnf back 这个错误
ib_logfile0 ib_logfile1 ibdata1 这些不能随便删除
你贴一下你 /etc/my.cnf 配置文件看一下
页: [1]
查看完整版本: centos7 core lnmp1.6 MySQL无法启动