无法重新启动由InnoDB引起的MySQL

时间:2019-05-16 03:15:29

标签: mysql innodb windows-subsystem-for-linux

我无法重新启动MySQL或从(InnoDB表)恢复MySQL

  • 我有一个使用Ubuntu 16.04的WSL。由于“未知”事故,我早上无法访问MySQL。试图重新启动它和...所有错误。 尝试了有关InnoDB和log *文件的所有建议。但是没有成功。 我做了备份/ var / lib / mysql并重新安装了WSL的新实例-Ubuntu 16.04

  • 试图从物理备份文件(日志*和数据文件以及数据库目录)中恢复。但是仍然有相同的错误。

[更新1]

遵循本指南:https://dba.stackexchange.com/questions/71596/restoring-mysql-tables-from-ibd-frm-and-mysqllogbin-files

  • 我已经重新安装了另一个WSL
  • 按照指南从.frm和.idb恢复数据库
  • 一切顺利,直到导入桌面。 MySQL一直在说: ERROR 1812 (HY000): Tablespace is missing for table `dbname`.`table`
2019-05-16T03:04:36.061132Z mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
2019-05-16T03:04:36.207628Z 0 [Warning] Changed limits: max_open_files: 1024 (requested 5000)
2019-05-16T03:04:36.208347Z 0 [Warning] Changed limits: table_open_cache: 431 (requested 2000)
2019-05-16T03:04:36.472045Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2019-05-16T03:04:36.481592Z 0 [Note] /usr/sbin/mysqld (mysqld 5.7.26-0ubuntu0.16.04.1) starting as process 15703 ...
2019-05-16T03:04:36.503219Z 0 [Note] InnoDB: PUNCH HOLE support available
2019-05-16T03:04:36.503655Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2019-05-16T03:04:36.503712Z 0 [Note] InnoDB: Uses event mutexes
2019-05-16T03:04:36.503749Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2019-05-16T03:04:36.503783Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.8
2019-05-16T03:04:36.503823Z 0 [Note] InnoDB: Using Linux native AIO
2019-05-16T03:04:36.504677Z 0 [Note] InnoDB: Number of pools: 1
2019-05-16T03:04:36.505431Z 0 [Note] InnoDB: Using CPU crc32 instructions
2019-05-16T03:04:36.521629Z 0 [ERROR] InnoDB: Linux Native AIO interface is not supported on this platform. Please check your OS documentation and install appropriate binary of InnoDB.
2019-05-16T03:04:36.521855Z 0 [Note] InnoDB: You can disable Linux Native AIO by setting innodb_use_native_aio = 0 in my.cnf
2019-05-16T03:04:36.521899Z 0 [Warning] InnoDB: Linux Native AIO disabled.
2019-05-16T03:04:36.525155Z 0 [Note] InnoDB: Initializing buffer pool, total size = 4G, instances = 8, chunk size = 128M
2019-05-16T03:04:37.245621Z 0 [Note] InnoDB: Completed initialization of buffer pool
2019-05-16T03:04:37.452784Z 0 [Note] InnoDB: page_cleaner coordinator priority: -20
2019-05-16T03:04:37.453044Z 0 [Note] InnoDB: page_cleaner worker priority: -20
2019-05-16T03:04:37.453378Z 0 [Note] InnoDB: page_cleaner worker priority: -20
2019-05-16T03:04:37.453477Z 0 [Note] InnoDB: page_cleaner worker priority: -20
2019-05-16T03:04:37.461387Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
2019-05-16T03:04:37.587188Z 0 [ERROR] InnoDB: Ignoring the redo log due to missing MLOG_CHECKPOINT between the checkpoint 22709914082 and the end 22709914054.
2019-05-16T03:04:37.587391Z 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error
2019-05-16T03:04:37.890878Z 0 [ERROR] Plugin 'InnoDB' init function returned error.
2019-05-16T03:04:37.891081Z 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2019-05-16T03:04:37.891128Z 0 [ERROR] Failed to initialize builtin plugins.
2019-05-16T03:04:37.891164Z 0 [ERROR] Aborting

2019-05-16T03:04:37.891207Z 0 [Note] Binlog end
2019-05-16T03:04:37.891332Z 0 [Note] Shutting down plugin 'CSV'
2019-05-16T03:04:37.891962Z 0 [Note] /usr/sbin/mysqld: Shutdown complete

2019-05-16T03:04:37.959132Z mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended ````

2 个答案:

答案 0 :(得分:1)

对于 [错误] InnoDB:此平台不支持Linux本机AIO接口。请检查您的操作系统文档并安装适当的InnoDB二进制文件。
解决方案:
/etc/mysql/my.cnf

中添加以下行
[mysqld]
innodb_use_native_aio = 0

对于 [ERROR] InnoDB:由于在检查点92858715和末端92858687之间缺少MLOG_CHECKPOINT而忽略了重做日志。
解决方案:
/ var / lib / mysql

删除ib_logfiles
sudo rm -rf /var/lib/mysql/ib_logfile*

答案 1 :(得分:0)

我有类似的问题。我在docker中使用MySQL,但两者的解决方案相同。您需要删除ib_logfiles 如果您不使用docker,那么

rm -rf /var/lib/mysql/ib_logfile*

如果您使用docker,那么

cd /your_mount_path/

然后运行

rm -rf * ib_logfile*

注意:当我最终丢失数据时,请确保备份数据或卷。