在 Ubuntu 16.04 上更新后无法启动 mysql 服务器
Can't start mysql server after update on Ubuntu 16.04
我在服务器上使用 mysql 时遇到问题。更新后 mysql 在我的系统上停止工作。它似乎在启动后立即崩溃,所以我什至无法备份我的数据库,因为该服务不是 运行。
我的 mysql 错误日志包含以下内容:
tail -70 /var/log/mysql/error.log
2017-07-27T06:56:20.080287Z 0 [ERROR] InnoDB: Your database may be corrupt or you may have copied the InnoDB tablespace but not the InnoDB log files. Please refer to http://dev.mysql.com/doc/refman/5.7/en/forcing-innodb-recovery.html for information about forcing recovery.
2017-07-27T06:56:20.080330Z 0 [ERROR] InnoDB: Page [page id: space=0, page number=406] log sequence number 199107155900 is in the future! Current system log sequence number 191999990814.
2017-07-27T06:56:20.080336Z 0 [ERROR] InnoDB: Your database may be corrupt or you may have copied the InnoDB tablespace but not the InnoDB log files. Please refer to http://dev.mysql.com/doc/refman/5.7/en/forcing-innodb-recovery.html for information about forcing recovery.
2017-07-27T06:56:20.080432Z 0 [ERROR] InnoDB: Page [page id: space=0, page number=208] log sequence number 199110108309 is in the future! Current system log sequence number 191999990814.
2017-07-27T06:56:20.080440Z 0 [ERROR] InnoDB: Your database may be corrupt or you may have copied the InnoDB tablespace but not the InnoDB log files. Please refer to http://dev.mysql.com/doc/refman/5.7/en/forcing-innodb-recovery.html for information about forcing recovery.
2017-07-27T06:56:20.080481Z 0 [ERROR] InnoDB: Page [page id: space=0, page number=735] log sequence number 196716783961 is in the future! Current system log sequence number 191999990814.
2017-07-27T06:56:20.080488Z 0 [ERROR] InnoDB: Your database may be corrupt or you may have copied the InnoDB tablespace but not the InnoDB log files. Please refer to http://dev.mysql.com/doc/refman/5.7/en/forcing-innodb-recovery.html for information about forcing recovery.
2017-07-27T06:56:20.080530Z 0 [ERROR] InnoDB: Page [page id: space=0, page number=378] log sequence number 199109175046 is in the future! Current system log sequence number 191999990814.
2017-07-27T06:56:20.080536Z 0 [ERROR] InnoDB: Your database may be corrupt or you may have copied the InnoDB tablespace but not the InnoDB log files. Please refer to http://dev.mysql.com/doc/refman/5.7/en/forcing-innodb-recovery.html for information about forcing recovery.
2017-07-27T06:56:20.080586Z 0 [ERROR] InnoDB: Page [page id: space=0, page number=209] log sequence number 199110429878 is in the future! Current system log sequence number 191999990814.
2017-07-27T06:56:20.080598Z 0 [ERROR] InnoDB: Your database may be corrupt or you may have copied the InnoDB tablespace but not the InnoDB log files. Please refer to http://dev.mysql.com/doc/refman/5.7/en/forcing-innodb-recovery.html for information about forcing recovery.
2017-07-27T06:56:20.080641Z 0 [ERROR] InnoDB: Page [page id: space=0, page number=342] log sequence number 199106867077 is in the future! Current system log sequence number 191999990814.
2017-07-27T06:56:20.080647Z 0 [ERROR] InnoDB: Your database may be corrupt or you may have copied the InnoDB tablespace but not the InnoDB log files. Please refer to http://dev.mysql.com/doc/refman/5.7/en/forcing-innodb-recovery.html for information about forcing recovery.
2017-07-27T06:56:20.080690Z 0 [ERROR] InnoDB: Page [page id: space=0, page number=16395] log sequence number 199094094548 is in the future! Current system log sequence number 191999990814.
2017-07-27T06:56:20.080701Z 0 [ERROR] InnoDB: Your database may be corrupt or you may have copied the InnoDB tablespace but not the InnoDB log files. Please refer to http://dev.mysql.com/doc/refman/5.7/en/forcing-innodb-recovery.html for information about forcing recovery.
2017-07-27 08:56:20 0xb7343700 InnoDB: Assertion failure in thread 3073652480 in file fut0lst.ic line 85
InnoDB: Failing assertion: addr.page == FIL_NULL || addr.boffset >= FIL_PAGE_DATA
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.7/en/forcing-innodb-recovery.html
InnoDB: about forcing recovery.
06:56:20 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.
Attempting to collect some information that could help diagnose the problem.
As this is a crash and something is definitely wrong, the information
collection process might fail.
key_buffer_size=16777216
read_buffer_size=131072
max_used_connections=0
max_threads=151
thread_count=0
connection_count=0
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 75717 K bytes of memory
Hope that's ok; if not, decrease some variables in the equation.
Thread pointer: 0x0
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
stack_bottom = 0 thread_stack 0x30000
/usr/sbin/mysqld(my_print_stacktrace+0x3c)[0x8a8b33c]
/usr/sbin/mysqld(handle_fatal_signal+0x426)[0x837f356]
[0xb77c0c14]
[0xb77c0c31]
/lib/i386-linux-gnu/libc.so.6(gsignal+0x39)[0xb738bea9]
/lib/i386-linux-gnu/libc.so.6(abort+0x157)[0xb738d407]
/usr/sbin/mysqld[0x8355dcf]
/usr/sbin/mysqld(_Z19trx_undo_lists_initP10trx_rseg_t+0xddc)[0x8d394dc]
/usr/sbin/mysqld[0x8d1d60f]
/usr/sbin/mysqld[0x8d203ec]
/usr/sbin/mysqld(_Z24trx_sys_init_at_db_startv+0x18cc)[0x8d2792c]
/usr/sbin/mysqld(_Z34innobase_start_or_create_for_mysqlv+0x5382)[0x8ceaa32]
/usr/sbin/mysqld[0x8b98d0e]
/usr/sbin/mysqld(_Z24ha_initialize_handlertonP13st_plugin_int+0x52)[0x83ccfd2]
/usr/sbin/mysqld[0x88611a2]
/usr/sbin/mysqld(_Z11plugin_initPiPPci+0x60f)[0x886916f]
/usr/sbin/mysqld[0x8377795]
/usr/sbin/mysqld(_Z11mysqld_mainiPPc+0x83b)[0x837906b]
/usr/sbin/mysqld(main+0x27)[0x8357917]
/lib/i386-linux-gnu/libc.so.6(__libc_start_main+0xf7)[0xb7378637]
/usr/sbin/mysqld[0x836f4dc]
The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains
information that should help you find out what is causing the crash.
看来InnoDB有问题
因此,我已经尝试调整我的 my.conf 文件并添加了以下行:
[mysqld]
innodb_force_recovery = 4
尝试重启后(systemctl restart mysql.service)还是一样的问题
我也试过完全重新安装mysql-server,但还是一样的问题。
我还尝试备份来自 /var/lib/mysql 和 运行 的每个文件:
mkdir /root/backup_mysql/
mv /var/lib/mysql/* /root/backup_mysql/
dpkg --configure mysql-server-5.7
但即使在那之后它仍然是同样的问题。
你知道如何解决这个问题吗?
此问题与 MySql
数据库引擎 InnoDb
用于 CRUD 操作的 tablespace
有关。
使用
[mysqld]
innodb_force_recovery = 1
Lets the server run even if it detects a corrupt page. Tries to make SELECT * FROM tbl_name jump over corrupt index records and pages, which helps in dumping tables.
这似乎对您的情况有帮助,有关更多信息,请参阅 mysql manual,您的错误日志中也有同样的建议。
如果您在不了解它们的影响的情况下使用不同的值,您最终可能会丢失数据。所以要小心。
如果数据不是那么重要,您可以从您的系统中完全删除 mysql
并小心地重新安装它,这很有希望。
如何彻底删除mysql
?
转到系统中的 /var/lib/mysql/
类似的东西,删除 mysql
文件夹并从 /etc/mysql
文件夹中手动删除配置文件。
更新您的 ubuntu 存储库并重新安装 mysql。
我在服务器上使用 mysql 时遇到问题。更新后 mysql 在我的系统上停止工作。它似乎在启动后立即崩溃,所以我什至无法备份我的数据库,因为该服务不是 运行。 我的 mysql 错误日志包含以下内容:
tail -70 /var/log/mysql/error.log
2017-07-27T06:56:20.080287Z 0 [ERROR] InnoDB: Your database may be corrupt or you may have copied the InnoDB tablespace but not the InnoDB log files. Please refer to http://dev.mysql.com/doc/refman/5.7/en/forcing-innodb-recovery.html for information about forcing recovery.
2017-07-27T06:56:20.080330Z 0 [ERROR] InnoDB: Page [page id: space=0, page number=406] log sequence number 199107155900 is in the future! Current system log sequence number 191999990814.
2017-07-27T06:56:20.080336Z 0 [ERROR] InnoDB: Your database may be corrupt or you may have copied the InnoDB tablespace but not the InnoDB log files. Please refer to http://dev.mysql.com/doc/refman/5.7/en/forcing-innodb-recovery.html for information about forcing recovery.
2017-07-27T06:56:20.080432Z 0 [ERROR] InnoDB: Page [page id: space=0, page number=208] log sequence number 199110108309 is in the future! Current system log sequence number 191999990814.
2017-07-27T06:56:20.080440Z 0 [ERROR] InnoDB: Your database may be corrupt or you may have copied the InnoDB tablespace but not the InnoDB log files. Please refer to http://dev.mysql.com/doc/refman/5.7/en/forcing-innodb-recovery.html for information about forcing recovery.
2017-07-27T06:56:20.080481Z 0 [ERROR] InnoDB: Page [page id: space=0, page number=735] log sequence number 196716783961 is in the future! Current system log sequence number 191999990814.
2017-07-27T06:56:20.080488Z 0 [ERROR] InnoDB: Your database may be corrupt or you may have copied the InnoDB tablespace but not the InnoDB log files. Please refer to http://dev.mysql.com/doc/refman/5.7/en/forcing-innodb-recovery.html for information about forcing recovery.
2017-07-27T06:56:20.080530Z 0 [ERROR] InnoDB: Page [page id: space=0, page number=378] log sequence number 199109175046 is in the future! Current system log sequence number 191999990814.
2017-07-27T06:56:20.080536Z 0 [ERROR] InnoDB: Your database may be corrupt or you may have copied the InnoDB tablespace but not the InnoDB log files. Please refer to http://dev.mysql.com/doc/refman/5.7/en/forcing-innodb-recovery.html for information about forcing recovery.
2017-07-27T06:56:20.080586Z 0 [ERROR] InnoDB: Page [page id: space=0, page number=209] log sequence number 199110429878 is in the future! Current system log sequence number 191999990814.
2017-07-27T06:56:20.080598Z 0 [ERROR] InnoDB: Your database may be corrupt or you may have copied the InnoDB tablespace but not the InnoDB log files. Please refer to http://dev.mysql.com/doc/refman/5.7/en/forcing-innodb-recovery.html for information about forcing recovery.
2017-07-27T06:56:20.080641Z 0 [ERROR] InnoDB: Page [page id: space=0, page number=342] log sequence number 199106867077 is in the future! Current system log sequence number 191999990814.
2017-07-27T06:56:20.080647Z 0 [ERROR] InnoDB: Your database may be corrupt or you may have copied the InnoDB tablespace but not the InnoDB log files. Please refer to http://dev.mysql.com/doc/refman/5.7/en/forcing-innodb-recovery.html for information about forcing recovery.
2017-07-27T06:56:20.080690Z 0 [ERROR] InnoDB: Page [page id: space=0, page number=16395] log sequence number 199094094548 is in the future! Current system log sequence number 191999990814.
2017-07-27T06:56:20.080701Z 0 [ERROR] InnoDB: Your database may be corrupt or you may have copied the InnoDB tablespace but not the InnoDB log files. Please refer to http://dev.mysql.com/doc/refman/5.7/en/forcing-innodb-recovery.html for information about forcing recovery.
2017-07-27 08:56:20 0xb7343700 InnoDB: Assertion failure in thread 3073652480 in file fut0lst.ic line 85
InnoDB: Failing assertion: addr.page == FIL_NULL || addr.boffset >= FIL_PAGE_DATA
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.7/en/forcing-innodb-recovery.html
InnoDB: about forcing recovery.
06:56:20 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.
Attempting to collect some information that could help diagnose the problem.
As this is a crash and something is definitely wrong, the information
collection process might fail.
key_buffer_size=16777216
read_buffer_size=131072
max_used_connections=0
max_threads=151
thread_count=0
connection_count=0
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 75717 K bytes of memory
Hope that's ok; if not, decrease some variables in the equation.
Thread pointer: 0x0
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
stack_bottom = 0 thread_stack 0x30000
/usr/sbin/mysqld(my_print_stacktrace+0x3c)[0x8a8b33c]
/usr/sbin/mysqld(handle_fatal_signal+0x426)[0x837f356]
[0xb77c0c14]
[0xb77c0c31]
/lib/i386-linux-gnu/libc.so.6(gsignal+0x39)[0xb738bea9]
/lib/i386-linux-gnu/libc.so.6(abort+0x157)[0xb738d407]
/usr/sbin/mysqld[0x8355dcf]
/usr/sbin/mysqld(_Z19trx_undo_lists_initP10trx_rseg_t+0xddc)[0x8d394dc]
/usr/sbin/mysqld[0x8d1d60f]
/usr/sbin/mysqld[0x8d203ec]
/usr/sbin/mysqld(_Z24trx_sys_init_at_db_startv+0x18cc)[0x8d2792c]
/usr/sbin/mysqld(_Z34innobase_start_or_create_for_mysqlv+0x5382)[0x8ceaa32]
/usr/sbin/mysqld[0x8b98d0e]
/usr/sbin/mysqld(_Z24ha_initialize_handlertonP13st_plugin_int+0x52)[0x83ccfd2]
/usr/sbin/mysqld[0x88611a2]
/usr/sbin/mysqld(_Z11plugin_initPiPPci+0x60f)[0x886916f]
/usr/sbin/mysqld[0x8377795]
/usr/sbin/mysqld(_Z11mysqld_mainiPPc+0x83b)[0x837906b]
/usr/sbin/mysqld(main+0x27)[0x8357917]
/lib/i386-linux-gnu/libc.so.6(__libc_start_main+0xf7)[0xb7378637]
/usr/sbin/mysqld[0x836f4dc]
The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains
information that should help you find out what is causing the crash.
看来InnoDB有问题
因此,我已经尝试调整我的 my.conf 文件并添加了以下行:
[mysqld]
innodb_force_recovery = 4
尝试重启后(systemctl restart mysql.service)还是一样的问题
我也试过完全重新安装mysql-server,但还是一样的问题。
我还尝试备份来自 /var/lib/mysql 和 运行 的每个文件:
mkdir /root/backup_mysql/
mv /var/lib/mysql/* /root/backup_mysql/
dpkg --configure mysql-server-5.7
但即使在那之后它仍然是同样的问题。
你知道如何解决这个问题吗?
此问题与 MySql
数据库引擎 InnoDb
用于 CRUD 操作的 tablespace
有关。
使用
[mysqld]
innodb_force_recovery = 1
Lets the server run even if it detects a corrupt page. Tries to make SELECT * FROM tbl_name jump over corrupt index records and pages, which helps in dumping tables.
这似乎对您的情况有帮助,有关更多信息,请参阅 mysql manual,您的错误日志中也有同样的建议。
如果您在不了解它们的影响的情况下使用不同的值,您最终可能会丢失数据。所以要小心。
如果数据不是那么重要,您可以从您的系统中完全删除 mysql
并小心地重新安装它,这很有希望。
如何彻底删除mysql
?
转到系统中的 /var/lib/mysql/
类似的东西,删除 mysql
文件夹并从 /etc/mysql
文件夹中手动删除配置文件。
更新您的 ubuntu 存储库并重新安装 mysql。