你的位置:首页 > 信息动态 > 新闻中心
信息动态
联系我们

删除 jeesite 数据库导致 mysql 启动不了

2021/10/28 19:52:11
操作:
	1.试用 Sequel Pro 删除 jeesite 数据库,直接异常退出,然后导致 mysql 启动不了

	2.到 data 目录下查看,发现数据库还存在,直接使用 rm -rf jeesite,仍然启动不了

查看报错:
	上述2步操作执行后的报错,没有给记录下来。。。在网上也没搜到类似错误

	搜索解决方案:
		1>官方提示:
			http://dev.mysql.com/doc/refman/5.6/en/innodb-troubleshooting-datadict.html

		2>解决mysql 因Innodb意外终止无法启动的问题:
			https://blog.csdn.net/sinat_30175689/article/details/106994882

		3>MySQL误删除ibd文件导致数据库无法启动解决问题:
			https://www.cxyzjd.com/article/qq_20254865/108738991

		4>MySQL crashed, InnoDB fails to recover(这个和我的问题一致)
			https://dba.stackexchange.com/questions/138275/mysql-crashed-innodb-fails-to-recover

	最终解决思路:
		首次看文档,没看明白是啥意思

		我先想到的是:
			1>连接远程服务器上的数据库,然后jeesite初始化下数据库,得到/data/jeesite(如果是自定义了一些数据表的话,是不是也得重新新建这些表??),然后复制到本地,重启报错:
				2021-10-28 17:22:32 6129 [ERROR] InnoDB: Table 'jeesite/act_ge_bytearray' in InnoDB data dictionary has tablespace id 17263, but a tablespace with that id does not exist. There is a tablespace of name jeesite/act_ge_bytearray and id 1020, though. Have you deleted or moved .ibd files?

			2>突然意识到解决方案里说的意思,可能是只要 .frm 结构文件,然后从备份来进行恢复,然后删除了 /data/jeesite 下的所有 .ibd 文件,重启报错,这时候记录的和 '官方给出的报错是一致的',感觉游戏:
				2021-10-28 17:22:32 6129 [ERROR] InnoDB: Table jeesite/act_ge_bytearray in the InnoDB data dictionary has tablespace id 17263, but tablespace with that id or name does not exist. Have you deleted or moved .ibd files? This may also be a table created with CREATE TEMPORARY TABLE whose .ibd and .frm files MySQL automatically removed, but the table still exists in the InnoDB internal data dictionary.

			3>第四个解决方案里,提到了 'Adding innodb_force_recovery=3 in /etc/my.cnf',另外官方文档里,也提到了 “Forcing InnoDB Recovery”,强制 innodb 恢复,重启了下,可以了!!

			4>mysql 可以启动了,但是打开后,jeesite 下并未发现表,可能是我的备份里是删除的操作,不清楚