当前位置: 代码网 > it编程>数据库>Mysql > mysql断电后无法启动的问题小结

mysql断电后无法启动的问题小结

2024年05月27日 Mysql 我要评论
1、配置/etc/my.cnfinnodb_force_recovery=6(这个值越小越安全,最开始建议设置为1,如果也无法启动再改为2,以此内推)1 (srv_force_ignore_corru

1、配置/etc/my.cnf

innodb_force_recovery=6(这个值越小越安全,最开始建议设置为1,如果也无法启动再改为2,以此内推)
1 (srv_force_ignore_corrupt):即使服务器检测到损坏的页仍让它运行。试图使select* from tbl_name跳过损坏的索引记录和页,这样有助于转储表。
2 (srv_force_no_background):阻止主线程和任何清除线程的运行。如果崩溃会在清除操作中发生,该恢复值会阻止它。
3 (srv_force_no_trx_undo):不要在崩溃恢复后运行事务回滚。
4 (srv_force_no_ibuf_merge):阻止插入缓冲合并操作。如果它们会导致崩溃,不要做这些。不计算表统计。这个值可以永久损坏数据文件。使用这个值后,准备号删除并重建所有辅助索引。在mysql5.6.15中,设置innodb为只读。
5 (srv_force_no_undo_log_scan):在启动数据库时不查看撤消日志:innodb将即使未完成的事务也作为已提交。这个值可以永久损坏数据文件。在mysql5.6.15中,设置innodb为只读。
6 (srv_force_no_log_redo):不要通过恢复对重做日志进行前滚。这个值可能永久损坏数据文件。数据库页被留在一个陈旧的状态,这反过来又可能带给b-trees和其它数据库结构更多的损坏。在mysql5.6.15中,设置innodb为只读。 

2、重启服务

/etc/init.d/mysql start

3、异常点

2024-04-12t07:19:50.994404z mysqld_safe logging to '/usr/local/mysql/data/mysql.err'.
2024-04-12t07:19:51.048096z mysqld_safe starting mysqld daemon with databases from /usr/local/mysql/data
2024-04-12t07:19:51.063416z 0 [system] [my-015015] [server] mysql server - start.
2024-04-12t07:19:51.327272z 0 [warning] [my-011070] [server] 'disabling symbolic links using --skip-symbolic-links (or equivalent) is the default. consider not using this option as it' is deprecated and will be removed in a future release.
2024-04-12t07:19:51.327440z 0 [system] [my-010116] [server] /usr/local/mysql/bin/mysqld (mysqld 8.1.0) starting as process 28354
2024-04-12t07:19:51.340376z 1 [system] [my-013576] [innodb] innodb initialization has started.
2024-04-12t07:19:52.829398z 1 [system] [my-013577] [innodb] innodb initialization has ended.
2024-04-12t07:19:53.028010z 1 [warning] [my-011018] [innodb] skip updating information_schema metadata in innodb read-only mode.
2024-04-12t07:19:53.028118z 1 [warning] [my-010005] [server] skip re-populating collations and character sets tables in innodb read-only mode.
2024-04-12t07:19:53.060142z 2 [warning] [my-011018] [server] skip updating information_schema metadata in innodb read-only mode.
2024-04-12t07:19:53.061771z 0 [warning] [my-010970] [server] skipped updating resource group metadata in innodb read only mode.
2024-04-12t07:19:53.061840z 0 [warning] [my-010970] [server] skipped updating resource group metadata in innodb read only mode.
2024-04-12t07:19:53.238265z 0 [warning] [my-010068] [server] ca certificate ca.pem is self signed.
2024-04-12t07:19:53.238343z 0 [system] [my-013602] [server] channel mysql_main configured to support tls. encrypted connections are now supported for this channel.
2024-04-12t07:19:53.256339z 0 [error] [my-000067] [server] unknown variable 'innodb_purge_thread=0'.
2024-04-12t07:19:53.256463z 0 [error] [my-010119] [server] aborting
2024-04-12t07:19:53.896663z 0 [system] [my-010910] [server] /usr/local/mysql/bin/mysqld: shutdown complete (mysqld 8.1.0)  mysql community server - gpl.
2024-04-12t07:19:53.898123z 0 [system] [my-015016] [server] mysql server - end.
2024-04-12t07:19:54.069350z mysqld_safe mysqld from pid file /usr/local/mysql/data/mysql.pid ended

注意error部分,my。cnf配置文件有无法解析的参数,删掉就可以
4、恢复出错文件

到此这篇关于mysql断电后无法启动的问题小结的文章就介绍到这了,更多相关mysql断电后无法启动内容请搜索代码网以前的文章或继续浏览下面的相关文章希望大家以后多多支持代码网!

(0)

相关文章:

版权声明:本文内容由互联网用户贡献,该文观点仅代表作者本人。本站仅提供信息存储服务,不拥有所有权,不承担相关法律责任。 如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至 2386932994@qq.com 举报,一经查实将立刻删除。

发表评论

验证码:
Copyright © 2017-2025  代码网 保留所有权利. 粤ICP备2024248653号
站长QQ:2386932994 | 联系邮箱:2386932994@qq.com