mysql> show tables;ERROR 2006 (HY000): MySQL server has gone away
No connection. Trying to reconnect...
Connection id:    1
Current database: webobserver
 
ERROR 2006 (HY000): MySQL server has gone away
No connection. Trying to reconnect...
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (111)
ERROR: 
Can't connect to the server查看错误日志:Feb  9 11:51:39 urlauth-5 mysqld[5637]: 090209 11:51:39  InnoDB: Error: page 4 log sequence number 173 1404915596
Feb  9 11:51:39 urlauth-5 mysqld[5637]: InnoDB: is in the future! Current system log sequence number 173 1404912352.
Feb  9 11:51:39 urlauth-5 mysqld[5637]: InnoDB: Your database may be corrupt or you may have copied the InnoDB
Feb  9 11:51:39 urlauth-5 mysqld[5637]: InnoDB: tablespace but not the InnoDB log files. See
Feb  9 11:51:39 urlauth-5 mysqld[5637]: InnoDB: http://dev.mysql.com/doc/refman/5.0/en/forcing-recovery.html
Feb  9 11:51:39 urlauth-5 mysqld[5637]: InnoDB: for more information.
Feb  9 11:51:39 urlauth-5 mysqld[5637]: 090209 11:51:39  InnoDB: Error: page 2834433 log sequence number 173 1404914321
Feb  9 11:51:39 urlauth-5 mysqld[5637]: InnoDB: is in the future! Current system log sequence number 173 1404912352.
Feb  9 11:51:39 urlauth-5 mysqld[5637]: InnoDB: Your database may be corrupt or you may have copied the InnoDB
Feb  9 11:51:39 urlauth-5 mysqld[5637]: InnoDB: tablespace but not the InnoDB log files. See
Feb  9 11:51:39 urlauth-5 mysqld[5637]: InnoDB: http://dev.mysql.com/doc/refman/5.0/en/forcing-recovery.html
Feb  9 11:51:39 urlauth-5 mysqld[5637]: InnoDB: for more information.
Feb  9 11:51:39 urlauth-5 mysqld[5637]: InnoDB: 1 transaction(s) which must be rolled back or cleaned up
Feb  9 11:51:39 urlauth-5 mysqld[5637]: InnoDB: in total 1 row operations to undo
Feb  9 11:51:39 urlauth-5 mysqld[5637]: InnoDB: Trx id counter is 0 991831296
Feb  9 11:51:43 urlauth-5 mysqld[5637]: InnoDB: Starting in background the rollback of uncommitted transactions
Feb  9 11:51:43 urlauth-5 mysqld[5637]: InnoDB: Cleaning up trx with id 0 991830970
Feb  9 11:51:43 urlauth-5 mysqld[5637]: 090209 11:51:43  InnoDB: Rollback of non-prepared transactions completed
Feb  9 11:51:43 urlauth-5 mysqld[5637]: 090209 11:51:43  InnoDB: Started; log sequence number 173 1404912352
Feb  9 11:51:43 urlauth-5 mysqld[5637]: 090209 11:51:43 [Warning] 'user' entry 'root@lab-82' ignored in --skip-name-resolve mode.
Feb  9 11:51:43 urlauth-5 mysqld[5637]: 090209 11:51:43 [Warning] Neither --relay-log nor --relay-log-index were used; so replication may break when this MySQL server acts as a slave and has his hostname changed!! Please use '--relay-log=mysqld-relay-bin' to avoid this problem.
Feb  9 11:51:43 urlauth-5 mysqld[5637]: 090209 11:51:43 [Note] /usr/sbin/mysqld: ready for connections.
Feb  9 11:51:43 urlauth-5 mysqld[5637]: Version: '5.0.51a-3ubuntu5.3-log'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  (Ubuntu)
Feb  9 11:51:44 urlauth-5 mysqld[5637]: 090209 11:51:44  InnoDB: Warning: purge reached the head of the history list,
Feb  9 11:51:44 urlauth-5 mysqld[5637]: InnoDB: but its length is still reported as 12854894! Make a detailed bug
Feb  9 11:51:44 urlauth-5 mysqld[5637]: InnoDB: report, and post it to bugs.mysql.com
Feb  9 11:51:44 urlauth-5 mysqld[5637]: 090209 11:51:44  InnoDB: Error: page 12394513 log sequence number 173 1404915613
Feb  9 11:51:44 urlauth-5 mysqld[5637]: InnoDB: is in the future! Current system log sequence number 173 1404912352.
Feb  9 11:51:44 urlauth-5 mysqld[5637]: InnoDB: Your database may be corrupt or you may have copied the InnoDB
Feb  9 11:51:44 urlauth-5 mysqld[5637]: InnoDB: tablespace but not the InnoDB log files. See
Feb  9 11:51:44 urlauth-5 mysqld[5637]: InnoDB: http://dev.mysql.com/doc/refman/5.0/en/forcing-recovery.html
Feb  9 11:51:44 urlauth-5 mysqld[5637]: InnoDB: for more information.
Feb  9 11:51:44 urlauth-5 mysqld[5637]: 090209 11:51:44  InnoDB: Error: page 65537 log sequence number 173 1404915032
Feb  9 11:51:44 urlauth-5 mysqld[5637]: InnoDB: is in the future! Current system log sequence number 173 1404912352.
Feb  9 11:51:44 urlauth-5 mysqld[5637]: InnoDB: Your database may be corrupt or you may have copied the InnoDB
Feb  9 11:51:44 urlauth-5 mysqld[5637]: InnoDB: tablespace but not the InnoDB log files. See
Feb  9 11:51:44 urlauth-5 mysqld[5637]: InnoDB: http://dev.mysql.com/doc/refman/5.0/en/forcing-recovery.html
Feb  9 11:51:44 urlauth-5 mysqld[5637]: InnoDB: for more information.
Feb  9 11:51:44 urlauth-5 mysqld[5637]: 090209 11:51:44  InnoDB: Error: page 11863568 log sequence number 173 1404915596
Feb  9 11:51:44 urlauth-5 mysqld[5637]: InnoDB: is in the future! Current system log sequence number 173 1404912352.
Feb  9 11:51:44 urlauth-5 mysqld[5637]: InnoDB: Your database may be corrupt or you may have copied the InnoDB
Feb  9 11:51:44 urlauth-5 mysqld[5637]: InnoDB: tablespace but not the InnoDB log files. See
Feb  9 11:51:44 urlauth-5 mysqld[5637]: InnoDB: http://dev.mysql.com/doc/refman/5.0/en/forcing-recovery.html
Feb  9 11:51:44 urlauth-5 mysqld[5637]: InnoDB: for more information.访问myisam格式表是可以的,请高手帮忙解答解答,万分感激!!!

解决方案 »

  1.   

    InnoDB数据是不是直接从其他数据库拷贝过来用的?
    貌似这样拷贝不能直接使用的最好从原来的那个数据库通过mysqldump来备份,然后再通过mysql导入数据库
      

  2.   

    我后来又用mysqldump -uroot -p --all-database >all.sql 备份了所有数据库
    但恢复只能是指定数据库名的恢复,所有数据库怎么恢复呢??
      

  3.   

    把目标数据库先truncate一下,全部清空,以保证一个好环境。再把/var/lib/mysql下的mysql-bin.*、mysql-bin.index文件全部删除。重启,再往里面导入SQL备份文件试试?看报错文件有不同没?