启动 MySQL 数据库服务器:mysqld 。。。。。。。。。。。失败!

启动 MySQL 数据库服务器:mysqld 。。。。。。。。。。。失败!

我重新启动了我的 VPS 盒(手动/硬重启),从那时起,mysql 因某种原因无法启动。

我做了一个tail /var/log/syslog并得到了这个:

Feb 20 11:49:33 kyrgyznews mysqld[11461]:                                                                     ) ;InnoDB: End of page dump
575 Feb 20 11:49:33 kyrgyznews mysqld[11461]: 110220 11:49:33  InnoDB: Page checksum 1045788239, prior-to-4.0.14-form checksum 236985105
576 Feb 20 11:49:33 kyrgyznews mysqld[11461]: InnoDB: stored checksum 1178062585, prior-to-4.0.14-form stored checksum 236985105
577 Feb 20 11:49:33 kyrgyznews mysqld[11461]: InnoDB: Page lsn 0 10651, low 4 bytes of lsn at page end 10651
578 Feb 20 11:49:33 kyrgyznews mysqld[11461]: InnoDB: Page number (if stored to page already) 3,
579 Feb 20 11:49:33 kyrgyznews mysqld[11461]: InnoDB: space id (if created with >= MySQL-4.1.1 and stored already) 0
580 Feb 20 11:49:33 kyrgyznews mysqld[11461]: InnoDB: Database page corruption on disk or a failed
581 Feb 20 11:49:33 kyrgyznews mysqld[11461]: InnoDB: file read of page 3.
582 Feb 20 11:49:33 kyrgyznews mysqld[11461]: InnoDB: You may have to recover from a backup.
583 Feb 20 11:49:33 kyrgyznews mysqld[11461]: InnoDB: It is also possible that your operating
584 Feb 20 11:49:33 kyrgyznews mysqld[11461]: InnoDB: system has corrupted its own file cache
585 Feb 20 11:49:33 kyrgyznews mysqld[11461]: InnoDB: and rebooting your computer removes the
586 Feb 20 11:49:33 kyrgyznews mysqld[11461]: InnoDB: error.
587 Feb 20 11:49:33 kyrgyznews mysqld[11461]: InnoDB: If the corrupt page is an index page
588 Feb 20 11:49:33 kyrgyznews mysqld[11461]: InnoDB: you can also try to fix the corruption
589 Feb 20 11:49:33 kyrgyznews mysqld[11461]: InnoDB: by dumping, dropping, and reimporting
590 Feb 20 11:49:33 kyrgyznews mysqld[11461]: InnoDB: the corrupt table. You can use CHECK
591 Feb 20 11:49:33 kyrgyznews mysqld[11461]: InnoDB: TABLE to scan your table for corruption.
592 Feb 20 11:49:33 kyrgyznews mysqld[11461]: InnoDB: See also InnoDB: http://dev.mysql.com/doc/refman/5.0/en/forcing-recovery.html
593 Feb 20 11:49:33 kyrgyznews mysqld[11461]: InnoDB: about forcing recovery.
594 Feb 20 11:49:33 kyrgyznews mysqld[11461]: InnoDB: Ending processing because of a corrupt database page.
595 Feb 20 11:49:33 kyrgyznews mysqld_safe[11469]: ended
596 Feb 20 11:49:47 kyrgyznews /etc/init.d/mysql[12228]: 0 processes alive and '/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf ping' resulted in
597 Feb 20 11:49:47 kyrgyznews /etc/init.d/mysql[12228]: ^G/usr/bin/mysqladmin: connect to server at 'localhost' failed
598 Feb 20 11:49:47 kyrgyznews /etc/init.d/mysql[12228]: error: 'Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)'
599 Feb 20 11:49:47 kyrgyznews /etc/init.d/mysql[12228]: Check that mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock' exists!
600 Feb 20 11:49:47 kyrgyznews /etc/init.d/mysql[12228]:
601 Feb 20 11:49:56 kyrgyznews mysqld_safe[13437]: started
602 Feb 20 11:49:56 kyrgyznews mysqld[13440]: InnoDB: The log sequence number in ibdata files does not match
603 Feb 20 11:49:56 kyrgyznews mysqld[13440]: InnoDB: the log sequence number in the ib_logfiles!
604 Feb 20 11:49:56 kyrgyznews mysqld[13440]: 110220 11:49:56  InnoDB: Database was not shut down normally!
605 Feb 20 11:49:56 kyrgyznews mysqld[13440]: InnoDB: Starting crash recovery.
606 Feb 20 11:49:56 kyrgyznews mysqld[13440]: InnoDB: Reading tablespace information from the .ibd files...
607 Feb 20 11:49:56 kyrgyznews mysqld[13440]: InnoDB: Restoring possible half-written data pages from the doublewrite
608 Feb 20 11:49:56 kyrgyznews mysqld[13440]: InnoDB: buffer...
609 Feb 20 11:49:56 kyrgyznews mysqld[13440]: InnoDB: Database page corruption on disk or a failed
610 Feb 20 11:49:56 kyrgyznews mysqld[13440]: InnoDB: file read of page 3.
611 Feb 20 11:49:56 kyrgyznews mysqld[13440]: InnoDB: You may have to recover from a backup.

我看过它引用的页面,http://dev.mysql.com/doc/refman/5.0/en/forcing-innodb-recovery.html,但在设置之前,我想知道经验丰富的 DBA 会建议做什么?强制恢复有什么坏处吗?

PS - 我没有对 mysql 进行任何更新。版本是 mysql Ver 14.12 Distrib 5.0.51a,适用于 debian-linux-gnu (i486),使用 readline 5.2。

答案1

根据日志中的内容,我建议您运行一些磁盘检查,因为可能是磁盘错误导致数据库损坏。如果磁盘检查无误,并且无法修复数据库,您可能需要从备份中恢复。

答案2

确保文件 /var/run/mysqld/mysqld.sock 存在于你的服务器中。如果不存在,你可以创建它。本教程将帮助你http://anthologyoi.com/computers/cant-connect-to-local-mysql-server-through-socketerror.html

相关内容