mysql数据库崩溃:InnoDB: Database page corruption on disk or a failed
2016-11-12 21:44
197 查看
错误情况
linux上运行的mysql突然崩溃。然后就启动不了。查看mysql错误日志。
61111 17:24:20 mysqld_safe mysqld from pid file /home/mysql-data/bogon.pid ended
161111 17:24:46 mysqld_safe Starting mysqld daemon with databases from /home/mysql-data
161111 17:24:46 [Warning] ‘THREAD_CONCURRENCY’ is deprecated and will be removed in a future release.
161111 17:24:46 [Note] /usr[闪电]bexec/mysqld (mysqld 5.5.44-MariaDB) starting as process 14091 …
161111 17:24:46 InnoDB: The InnoDB memory heap is disabled
161111 17:24:46 InnoDB: Mutexes and rw_locks use GCC atomic builtins
161111 17:24:46 InnoDB: Compressed tables use zlib 1.2.7
161111 17:24:46 InnoDB: Using Linux native AIO
161111 17:24:46 InnoDB: Initializing buffer pool, size = 128.0M
161111 17:24:46 InnoDB: Completed initialization of buffer pool
161111 17:24:46 InnoDB: highest supported file format is Barracuda.
InnoDB: Log scan progressed past the checkpoint lsn 30277069237949
161111 17:24:46 InnoDB: Database was not shut down normally!
InnoDB: Starting crash recovery.
InnoDB: Reading tablespace information from the .ibd files…
InnoDB: Restoring possible half-written data pages from the doublewrite
InnoDB: buffer…
InnoDB: Doing recovery: scanned up to log sequence number 30277072845824
InnoDB: 2 transaction(s) which must be rolled back or cleaned up
InnoDB: in total 26141 row operations to undo
InnoDB: Trx id counter is 17BB0B00
161111 17:24:46 InnoDB: Starting an apply batch of log records to the database…
InnoDB: Progress in percents: 0 1 2 3 4 5 6 7 8 9 10 11 12 InnoDB: Database page corruption on disk or a failed
问题原因
数据库中表损坏导致数据访问错误,从而导致数据库崩溃;mysql中check table 发现表有损坏,但表是innodb类型不能修复。Innodb 自检过程中checksum与退出时不一致便会去recover;
问题解决
1、知道mysql配置文件,my.cnf。添加下面内容:
innodb_force_recovery=1
再启动mysql
则可以正常启动。
2、寻找到出错的表。
本人利用Navicat连接mysql服务器。
查看所有表,其中发现
表1:
表2:
可看到这两个表的第一行均有异常。
由于是强制启动(innodb_force_recovery=1),此时不能修改innodb引擎下的数据。
3、将这两个表导出成mysql文件。
再将这两个表删除。
复制mysql文件中的建表语句。由此新建两个与之前结构一样的表,但是存储引擎设置为MYISAM。
将mysql文件中的错误的那条语句删除。
将其他正常数据导入到数据库。
4、关闭mysql服务器。
将最开始添加的
innodb_force_recovery=1
删除。
重启mysql服务器。
将MYISAM引擎的两个表改为innodb。
(Navicat中,设计表->选项->innoDB->保存)
结束。
相关文章推荐
- InnoDB: Database page corruption on disk or a failed
- vmware:Cannot open the disk 'XXX' or one of the snapshot disks it depends on. reason: failed to lock
- vmware:Cannot open the disk 'XXX' or one of the snapshot disks it depends on. reason: failed to lock the file.
- ovs-vsctl: unix:/var/run/openvswitch/db.sock: database connection failed (No such file or directory)
- ORA-38760: This database instance failed to turn on flashback database
- ORA-38760: This database instance failed to turn on flashback database
- 2001528 - Linux: SAP HANA Database SPS 08 revision 80 (or higher) on RHEL 6 or SLES 11
- WARNING: the kernel failed to re-read the partition table on /dev/sda (Device or resource busy). .
- android update : folder failed to be renamed or moved on SDK install
- ThinkPHP 连接 mongo Authentication failed on database 'admin':
- fast incremental backup failed on standby database
- 解决 Stat Failed On ....No Such FIle or directory
- Warning: Unknown: failed to open stream: No such file or directory in Unknown on line 0
- HowTo Restore RMAN Disk backups of RAC Database to Single Instance On Another Node
- failed to open stream: No such file or directory in includes/src/Varien_Autoload.php on l
- fast incremental backup failed on standby database
- Mac OSX Yosemite 10.10 brew 错误:mktemp: mkdtemp failed on /tmp/git-LIPo: No such file or directory
- Validation failed for one or more entities while saving changes to SQL Server Database
- ORA-38760: This database instance failed to turn on flashback database
- EM 12c: OMS Failed to start After restarting the Repository Database or reboot of the server