您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

mysql数据库崩溃_MySQL

2025/8/3 22:35:48发布18次查看
bitscn.com
有一个crm系统,其中有做了一个报表统计,其中源码和数据库放在同意一台机子上,数据库用mysql;但在今天突然报错页面提示不能用root@locahost连接
用命令行登录,提示can't connection to mysql;再检查端口发现,数据库已经关闭;
现象:
crm可以登录,点击其他页面正常,当点击报表查看报表数据时就报错,并且数据库崩溃
初步分析认为程序错误或者数据库错误导致数据库崩溃从而自动断开
问题解决:
1.查看mysql数据库错误日志内容如下:
innodb: database page corruption on disk or a failed
innodb: file read of page 5761.
innodb: you may have to recover from a backup.
innodb: it is also possible that your operating
innodb: system has corrupted its own file cache
innodb: and rebooting your computer removes the
innodb: error.
innodb: if the corrupt page is an index page
innodb: you can also try to fix the corruption
innodb: by dumping, dropping, and reimporting
innodb: the corrupt table. you can use check
innodb: table to scan your table for corruption.
innodb: see also  http://dev.mysql.com/doc/refman/5.1/en/forcing-recovery.html
innodb: about forcing recovery.
innodb: ending processing because of a corrupt database page.
2.网上搜索该问题,原因为:
数据库中表损坏导致数据访问错误,从而导致数据库崩溃;mysql中check table 发现表有损坏,但表是innodb类型不能修复
网上解决方法为:在my.ini中mysqld下添加innodb_force_recovery=4
说明:
1(srv_force_ignore_corrupt):忽略检查到的corrupt页。
2(srv_force_no_background):阻止主线程的运行,如主线程需要执行full purge操作,会导致crash。
3(srv_force_no_trx_undo):不执行事务回滚操作。
4(srv_force_no_ibuf_merge):不执行插入缓冲的合并操作。
5(srv_force_no_undo_log_scan):不查看重做日志,innodb存储引擎会将未提交的事务视为已提交。
6(srv_force_no_log_redo):不执行前滚的操作。
3.重启数据库后问题依然存在,再对照错误发现自己的错误为corrupt类型,所以认为应将innodb_force_recovery设置为1,于是my.ini中innodb_force_recovery值改为1,重启数据库
4.发现重启后问题依然存在
5.于是再做如下操作:(重要)
修改my.ini 将innodb_force_recovery这行注释
#innodb_force_recovery=1
然后重启数据库,在停止数据库,在修改my.ini,去掉注释
innodb_force_recovery=1
重启数据库,问题解决
ps:对于第五步的操作一直没想明白,为什么要先注释掉重启后在打开才能生效,个人认为可能是有什么地方缓存导致的吧。在此记录,继续探索问题的根源。。。
摘自 冰糖葫芦的专栏
bitscn.com
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product