首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >mysql不能启动,不能转储。错误:第5页日志序列号

mysql不能启动,不能转储。错误:第5页日志序列号
EN

Database Administration用户
提问于 2016-08-11 10:27:13
回答 1查看 3K关注 0票数 1

启动MySQL数据库时,MySQL中有一个错误。错误显示如下所述;

代码语言:javascript
复制
Aug 11 13:03:28 kutuphane mysqld_safe: Starting mysqld daemon with databases from /var/lib/mysql
Aug 11 13:03:28 kutuphane mysqld: 160811 13:03:28 [Note] Plugin 'FEDERATED' is disabled.
Aug 11 13:03:28 kutuphane mysqld: #007/usr/sbin/mysqld: Incorrect information in file: './mysql/plugin.frm'
Aug 11 13:03:28 kutuphane mysqld: 160811 13:03:28 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
Aug 11 13:03:28 kutuphane mysqld: 160811 13:03:28  InnoDB: Initializing buffer pool, size = 8.0M
Aug 11 13:03:28 kutuphane mysqld: 160811 13:03:28  InnoDB: Completed initialization of buffer pool
Aug 11 13:03:28 kutuphane mysqld: InnoDB: The log sequence number in ibdata files does not match
Aug 11 13:03:28 kutuphane mysqld: InnoDB: the log sequence number in the ib_logfiles!
Aug 11 13:03:28 kutuphane mysqld: 160811 13:03:28  InnoDB: Database was not shut down normally!
Aug 11 13:03:28 kutuphane mysqld: InnoDB: Starting crash recovery.
Aug 11 13:03:28 kutuphane mysqld: InnoDB: Reading tablespace information from the .ibd files...
Aug 11 13:03:28 kutuphane mysqld: InnoDB: Restoring possible half-written data pages from the doublewrite
Aug 11 13:03:28 kutuphane mysqld: InnoDB: buffer...
Aug 11 13:03:28 kutuphane mysqld: 160811 13:03:28  InnoDB: Error: page 5 log sequence number 0 69715
Aug 11 13:03:28 kutuphane mysqld: InnoDB: is in the future! Current system log sequence number 0 69644.
Aug 11 13:03:28 kutuphane mysqld: InnoDB: Your database may be corrupt or you may have copied the InnoDB
Aug 11 13:03:28 kutuphane mysqld: InnoDB: tablespace but not the InnoDB log files. See
Aug 11 13:03:28 kutuphane mysqld: InnoDB: http://dev.mysql.com/doc/refman/5.1/en/forcing-innodb-recovery.html
Aug 11 13:03:28 kutuphane mysqld: InnoDB: for more information.
Aug 11 13:03:28 kutuphane mysqld: 160811 13:03:28  InnoDB: Started; log sequence number 0 69644
Aug 11 13:03:28 kutuphane mysqld: 160811 13:03:28 [ERROR] /usr/sbin/mysqld: Incorrect information in file: './mysql/host.frm'
Aug 11 13:03:28 kutuphane mysqld: 160811 13:03:28 [ERROR] Fatal error: Can't open and lock privilege tables: Incorrect information in file: './mysql/host.frm'
Aug 11 13:03:28 kutuphane mysqld_safe: mysqld from pid file /var/run/mysqld/mysqld.pid ended
Aug 11 13:03:42 kutuphane /etc/init.d/mysql[3528]: 0 processes alive and '/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf ping' resulted in
Aug 11 13:03:42 kutuphane /etc/init.d/mysql[3528]: #007/usr/bin/mysqladmin: connect to server at 'localhost' failed
Aug 11 13:03:42 kutuphane /etc/init.d/mysql[3528]: error: 'Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)'
Aug 11 13:03:42 kutuphane /etc/init.d/mysql[3528]: Check that mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock' exists!
Aug 11 13:03:42 kutuphane /etc/init.d/mysql[3528]: 

这是my.cnf文件

代码语言:javascript
复制
[client]
port        = 3306
socket      = /var/run/mysqld/mysqld.sock

# Here is entries for some specific programs
# The following values assume you have at least 32M ram

# This was formally known as [safe_mysqld]. Both versions are currently parsed.
[mysqld_safe]
socket      = /var/run/mysqld/mysqld.sock
nice        = 0

[mysqld]
#
# * Basic Settings
#
user        = mysql
pid-file    = /var/run/mysqld/mysqld.pid
socket      = /var/run/mysqld/mysqld.sock
port        = 3306
basedir     = /usr
datadir     = /var/lib/mysql
tmpdir      = /tmp
language    = /usr/share/mysql/english
skip-external-locking
#
# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
bind-address        = localhost
#
# * Fine Tuning
#
key_buffer      = 16M
max_allowed_packet  = 16M
thread_stack        = 192K
thread_cache_size       = 8
# This replaces the startup script and checks MyISAM tables if needed
# the first time they are touched
myisam-recover         = BACKUP
#max_connections        = 1000
#table_cache            = 64
#thread_concurrency     = 10
#
# * Query Cache Configuration
#
query_cache_limit   = 1M
query_cache_size        = 16M
#
# * Logging and Replication
#
# Both location gets rotated by the cronjob.
# Be aware that this log type is a performance killer.
# As of 5.1 you can enable the log at runtime!
general_log_file        = /var/log/mysql/mysql.log
general_log             = 1
#
# Error logging goes to syslog due to /etc/mysql/conf.d/mysqld_safe_syslog.cnf.
#
# Here you can see queries with especially long duration
#log_slow_queries   = /var/log/mysql/mysql-slow.log
#long_query_time = 2
#log-queries-not-using-indexes
#
# The following can be used as easy to replay backup logs or for replication.
# note: if you are setting up a replication slave, see README.Debian about
#       other settings you may need to change.
#server-id      = 1
#log_bin            = /var/log/mysql/mysql-bin.log
expire_logs_days    = 10
max_binlog_size         = 100M
#binlog_do_db       = include_database_name
#binlog_ignore_db   = include_database_name
#
# * InnoDB
#
# InnoDB is enabled by default with a 10MB datafile in /var/lib/mysql/.
# Read the manual for more InnoDB related options. There are many!
#
# * Security Features
#
# Read the manual, too, if you want chroot!
# chroot = /var/lib/mysql/
#
# For generating SSL certificates I recommend the OpenSSL GUI "tinyca".
#
# ssl-ca=/etc/mysql/cacert.pem
# ssl-cert=/etc/mysql/server-cert.pem
# ssl-key=/etc/mysql/server-key.pem



[mysqldump]
quick
quote-names
max_allowed_packet  = 16M

[mysql]
#no-auto-rehash # faster start of mysql but no tab completition

[isamchk]
key_buffer      = 16M

#
# * IMPORTANT: Additional settings that can override those from this file!
#   The files must end with '.cnf', otherwise they'll be ignored.
#
!includedir /etc/mysql/conf.d/

我不能转储数据库,我应该怎么做才能到达数据库?

*更新*

我更改了参数innodb_force_recovery = 1,而不是它给出了相同的错误。错误在syslog文件中。

代码语言:javascript
复制
Aug 22 16:47:14 kutuphane mysqld: #007/usr/sbin/mysqld: Incorrect information in file: './mysql/plugin.frm'
Aug 22 16:47:14 kutuphane mysqld: 160822 16:47:14 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
Aug 22 16:47:14 kutuphane mysqld: 160822 16:47:14  InnoDB: Initializing buffer pool, size = 8.0M
Aug 22 16:47:14 kutuphane mysqld: 160822 16:47:14  InnoDB: Completed initialization of buffer pool
Aug 22 16:47:14 kutuphane mysqld: InnoDB: The log sequence number in ibdata files does not match
Aug 22 16:47:14 kutuphane mysqld: InnoDB: the log sequence number in the ib_logfiles!
Aug 22 16:47:14 kutuphane mysqld: 160822 16:47:14  InnoDB: Database was not shut down normally!
Aug 22 16:47:14 kutuphane mysqld: InnoDB: Starting crash recovery.
Aug 22 16:47:14 kutuphane mysqld: InnoDB: Reading tablespace information from the .ibd files...
Aug 22 16:47:14 kutuphane mysqld: InnoDB: Restoring possible half-written data pages from the doublewrite
Aug 22 16:47:14 kutuphane mysqld: InnoDB: buffer...
Aug 22 16:47:14 kutuphane mysqld: 160822 16:47:14  InnoDB: Error: page 5 log sequence number 0 69715
Aug 22 16:47:14 kutuphane mysqld: InnoDB: is in the future! Current system log sequence number 0 69644.
Aug 22 16:47:14 kutuphane mysqld: InnoDB: Your database may be corrupt or you may have copied the InnoDB
Aug 22 16:47:14 kutuphane mysqld: InnoDB: tablespace but not the InnoDB log files. See
Aug 22 16:47:14 kutuphane mysqld: InnoDB: http://dev.mysql.com/doc/refman/5.1/en/forcing-innodb-recovery.html
Aug 22 16:47:14 kutuphane mysqld: InnoDB: for more information.
Aug 22 16:47:14 kutuphane mysqld: 160822 16:47:14  InnoDB: Started; log sequence number 0 69644
Aug 22 16:47:14 kutuphane mysqld: InnoDB: !!! innodb_force_recovery is set to 1 !!!
Aug 22 16:47:14 kutuphane mysqld: 160822 16:47:14 [ERROR] /usr/sbin/mysqld: Incorrect information in file: './mysql/host.frm'
Aug 22 16:47:14 kutuphane mysqld: 160822 16:47:14 [ERROR] Fatal error: Can't open and lock privilege tables: Incorrect information in file: './mysql/host.frm'
Aug 22 16:47:14 kutuphane mysqld_safe: mysqld from pid file /var/run/mysqld/mysqld.pid ended
Aug 22 16:47:28 kutuphane /etc/init.d/mysql[24753]: 0 processes alive and '/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf ping' resulted in
Aug 22 16:47:28 kutuphane /etc/init.d/mysql[24753]: #007/usr/bin/mysqladmin: connect to server at 'localhost' failed
Aug 22 16:47:28 kutuphane /etc/init.d/mysql[24753]: error: 'Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)'
Aug 22 16:47:28 kutuphane /etc/init.d/mysql[24753]: Check that mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock' exists!
Aug 22 16:47:28 kutuphane /etc/init.d/mysql[24753]: 
EN

回答 1

Database Administration用户

发布于 2016-08-11 12:15:15

正如您的Mysql数据库错误显示的那样

代码语言:javascript
复制
Aug 11 13:03:28 kutuphane mysqld: 160811 13:03:28  InnoDB: Database was not shut down normally!
Aug 11 13:03:28 kutuphane mysqld: InnoDB: Starting crash recovery.
Aug 11 13:03:28 kutuphane mysqld: InnoDB: Reading tablespace information from the .ibd files...
Aug 11 13:03:28 kutuphane mysqld: InnoDB: Restoring possible half-written data pages from the doublewrite
Aug 11 13:03:28 kutuphane mysqld: InnoDB: buffer...
Aug 11 13:03:28 kutuphane mysqld: 160811 13:03:28  InnoDB: Error: page 5 log sequence number 0 69715
Aug 11 13:03:28 kutuphane mysqld: InnoDB: is in the future! Current system log sequence number 0 69644.
Aug 11 13:03:28 kutuphane mysqld: InnoDB: Your database may be corrupt or you may have copied the InnoDB
Aug 11 13:03:28 kutuphane mysqld: InnoDB: tablespace but not the InnoDB log files. See
Aug 11 13:03:28 kutuphane mysqld: InnoDB: http://dev.mysql.com/doc/refman/5.1/en/forcing-innodb-recovery.html

本部分http://dev.mysql.com/doc/refman/5.1/en/forcing-innodb-recovery.html作为MySQL文档强迫InnoDB恢复

由于数据库页损坏,所以无法启动mysql。备份崩溃的表。编辑您的/etc/my.cnf并添加

代码语言:javascript
复制
[mysqld]
innodb_force_recovery = 1

警告

仅在紧急情况下将innodb_force_recovery设置为大于0的值,以便启动InnoDB并转储表。在这样做之前,请确保您有数据库的备份副本,以防需要重新创建数据库。值4或更大可永久损坏数据文件。在成功测试了数据库的单独物理副本上的innodb_force_recovery设置之后,只能在生产服务器实例上使用4或更高的设置。当强制InnoDB恢复时,您应该始终从innodb_force_recovery=1开始,并且只在必要时增量地增加值。

正如乔纳森所写的那样,整个指令过程都是这里

参考这里

票数 -1
EN
页面原文内容由Database Administration提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://dba.stackexchange.com/questions/146496

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档