从零开始的Linux运维屌丝之路,资源免费分享平台   运维人员首选:简单、易用、高效、安全、稳定、社区活跃的开源软件

工作中MYSQL遇到的错误整理

发布:蔺要红08-29分类: MYSQL


mysqlbinlog日志恢复
[root@web01 backup]# mysqlbinlogmysql-bin.000009 mysql-bin.000010 --start-datetime='2019-06-24 02:23:00'>bin.sql
mysqlbinlog: unknown variable'default-character-set=utf8'

# 添加--no-defaults参数开始增量恢复

[root@web01 backup]# mysqlbinlog --no-defaults mysql-bin.000009 mysql-bin.000010 --start-datetime='2019-06-24 02:23:00'>bin.sql
 
kill-9 mysql进程  强制关闭服务导致innodb表空间或文件异常
InnoDB: Error: auto-extending data file ./ibdata1 is of a different size140624 18:51:58 [ERROR] Plugin 'InnoDB' init function returned error.
140624 18:51:58 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
140624 18:51:58 [ERROR] Unknown/unsupported storage engine: InnoDB
140624 18:51:58 [ERROR] Aborting

# 重建mysql 通过全量备份和增量备份恢复数据
 

命令行数据全备恢复出错:

[root@web data]# mysql -uroot -paXAD3349x1dF 479_shangtu_com</www/backup/2019_05_22_479_shangtu_com.sql
ERROR 1030 (HY000) at line 46: Got error -1 from storage engine


#解决方法my.conf配置文件
innodb_force_recovery= 0 调整这个参数为 0

数据库被强制停止,可能破坏了二进制文件
InnoDB: End of page dump
2018-05-23 21:10:08 7f6786710700 InnoDB: uncompressed page, stored checksum in field1 2222046951, calculated checksums for field1: crc32 2624418990, innodb 12552
80539, none 3735928559, stored checksum in field2 1914065653, calculated checksums for field2: crc32 2624418990, innodb 3045085343, none 3735928559, page LSN 555
 2748030571, low 4 bytes of LSN at page end 2748030571, page number (if stored to page already) 84692, space id (if created with >= MySQL-4.1.1 and stored alread
y) 2618
InnoDB: Page may be an index page where index id is 8005
InnoDB: Database page corruption on disk or a failed
InnoDB: file read of page 84692.
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.6/en/forcing-innodb-recovery.html
InnoDB: about forcing recovery.
InnoDB: Ending processing because of a corrupt database page.
2018-05-23 21:10:08 7f6786710700  InnoDB: Assertion failure in thread 140082613913344 in file buf0buf.cc line 4201
InnoDB: We intentionally generate a memory trap.
InnoDB: Submit a detailed bug report to http://bugs.mysql.com.
InnoDB: If you get repeated assertion failures or crashes, even
InnoDB: immediately after the mysqld startup, there may be
InnoDB: corruption in the InnoDB tablespace. Please refer to
InnoDB: http://dev.mysql.com/doc/refman/5.6/en/forcing-innodb-recovery.html
InnoDB: about forcing recovery.
13:10:08 UTC - mysqld got signal 6 ;
This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.
We will try our best to scrape up some info that will hopefully help
diagnose the problem, but since we have already crashed,
something is definitely wrong and this may fail.

# 解决过程也是通过修改my.conf配置文件 只有在紧急情况下才可以将innodb_force_recovery设为大于0的值
innodb_force_recovery = 1



SQLSTATE[HY000]: General error: 1030 Got error 28 from storage engine
# 错误原因:硬盘满了
 
温馨提示如有转载或引用以上内容之必要,敬请将本文链接作为出处标注,如有侵权我会在24小时之内删除!

欢迎使用手机扫描访问本站