VPS侦探论坛

 找回密码
 注册
查看: 165|回复: 6

centos7 core lnmp1.6 MySQL无法启动

[复制链接]
发表于 2020-7-3 11:42:29 | 显示全部楼层 |阅读模式



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

这是usr/local/mysql/var/localhost.err日志
700101  8:00:23 [Note] Plugin 'FEDERATED' is disabled.
700101  8:00:23 InnoDB: The InnoDB memory heap is disabled
700101  8:00:23 InnoDB: Mutexes and rw_locks use GCC atomic builtins
700101  8:00:23 InnoDB: Compressed tables use zlib 1.2.11
700101  8:00:23 InnoDB: Using Linux native AIO
700101  8:00:23 InnoDB: Initializing buffer pool, size = 16.0M
700101  8:00:24 InnoDB: Completed initialization of buffer pool
700101  8:00:24 InnoDB: highest supported file format is Barracuda.
700101  8:00:24  InnoDB: Waiting for the background threads to start
美国VPS推荐: 遨游主机LinodeLOCVPSKVMLAVPS2EZ搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2020-7-3 16:22:12 | 显示全部楼层


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

启动mysql,看能否正常启动,如果可以启动尝试修复表,再去掉innodb_force_recovery=6 重启看看能否正常
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2020-7-3 18:11:11 | 显示全部楼层



licess 发表于 2020-7-3 16:22
先备份数据库目录
在/etc/my.cnf 里[mysqld]
下面加上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 [ERROR] Plugin 'InnoDB' init function returned error.
200703 18:07:26 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
200703 18:07:26 [ERROR] Unknown/unsupported storage engine: InnoDB
200703 18:07:26 [ERROR] 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 [ERROR] Plugin 'InnoDB' init function returned error.
200703 18:09:40 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
200703 18:09:40 [ERROR] Unknown/unsupported storage engine: InnoDB
200703 18:09:40 [ERROR] Aborting

200703 18:09:40 [Note] /usr/local/mysql/bin/mysqld: Shutdown complete
美国VPS推荐: 遨游主机LinodeLOCVPSKVMLAVPS2EZ搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
 楼主| 发表于 2020-7-3 18:23:21 | 显示全部楼层



现在好了,删除了ib_logfile0 ib_logfile1 ibdata1后解决
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2020-7-3 18:32:04 | 显示全部楼层

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

美国VPS、VPN、域名代购:http://shop63846532.taobao.com/

 楼主| 发表于 2020-7-3 18:36:15 | 显示全部楼层

这是使用Navicat查看表的截图

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?注册

x
发表于 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 配置文件看一下
美国VPS推荐: 遨游主机LinodeLOCVPSKVMLAVPS2EZ搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|VPS侦探 ( 鲁ICP备16040043号-1 )

GMT+8, 2020-8-12 23:24 , Processed in 0.051699 second(s), 27 queries .

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表