gpt4 book ai didi

database - InnoDB : Error: space header page consists of zero bytes in data file ./ibdata1

转载 作者:太空狗 更新时间:2023-10-30 01:48:21 27 4
gpt4 key购买 nike

我有一个非常好的 wordpress 设置,但今天服务器突然停止加载我的网站。我登录并重新启动了我的 centos 7 VPS。重启后它没有启动 MariaDB。这是我在日志中找到的内容:

141026 18:13:50 [Note] /usr/libexec/mysqld: Shutdown complete

141026 18:13:50 mysqld_safe mysqld from pid file /var/run/mariadb/mariadb.pid ended
141026 18:14:58 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
141026 18:14:58 InnoDB: The InnoDB memory heap is disabled
141026 18:14:58 InnoDB: Mutexes and rw_locks use GCC atomic builtins
141026 18:14:58 InnoDB: Compressed tables use zlib 1.2.7
141026 18:14:58 InnoDB: Using Linux native AIO
141026 18:14:58 InnoDB: Initializing buffer pool, size = 128.0M
141026 18:14:58 InnoDB: Completed initialization of buffer pool
InnoDB: Error: space header page consists of zero bytes in data file ./ibdata1
141026 18:14:58 InnoDB: Could not open or create data files.
141026 18:14:58 InnoDB: If you tried to add new data files, and it failed here,
141026 18:14:58 InnoDB: you should now edit innodb_data_file_path in my.cnf back
141026 18:14:58 InnoDB: to what it was, and remove the new ibdata files InnoDB created
141026 18:14:58 InnoDB: in this failed attempt. InnoDB only wrote those files full of
141026 18:14:58 InnoDB: zeros, but did not yet use them in any way. But be careful: do not
141026 18:14:58 InnoDB: remove old data files which contain your precious data!
141026 18:14:58 [ERROR] Plugin 'InnoDB' init function returned error.
141026 18:14:58 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
141026 18:14:58 [Note] Plugin 'FEEDBACK' is disabled.
141026 18:14:58 [ERROR] Unknown/unsupported storage engine: InnoDB
141026 18:14:58 [ERROR] Aborting

有人可以帮我调查可能是什么问题吗?现在是否可以在无法启动 MariaDB 的情况下备份我的数据库?

最佳答案

编辑:将my-innodb-heavy-4G.cnf复制到/etc/my.cnf.d,服务器启动正常.可能是改变binlog大小造成的。


听起来您更改了 InnoDB 缓冲区的大小,或者它已损坏。可能这些更改是在一段时间之前进行的,并且在您重新启动时才生效。

一定要首先备份您在 /var/lib/mysql 中的数据 - 最好是整个目录。

cp -R /var/lib/mysql /var/lib/mysql-backup

备份数据后,最好的第一步是恢复对 /etc/my.cnf 文件所做的任何更改并重新启动。

如果这样做不起作用,或者您不知道缓冲区的大小曾经是多少,下一个可能的选择是删除 InnoDB 二进制日志文件并让 MariaDB/MySQL 重新创建它们。这些文件名为 /var/lib/mysql/ib_logfile{N},其中 {N} 是一个数字。

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

如果这不能解决问题,请尝试将以下内容添加到您的/etc/my.cnf(或者您使用的任何配置文件,当然要先备份)。它应该放在 [innodb] 部分。

innodb_buffer_pool_size        = 256M
innodb_log_file_size = 256M
innodb_thread_concurrency = 16
innodb_flush_log_at_trx_commit = 2
innodb_flush_method = normal

诀窍在于了解 MariaDB 的期望。如果上面的操作没有成功,请尝试仅最后一行并设置[innodb_flush_method]

关于database - InnoDB : Error: space header page consists of zero bytes in data file ./ibdata1,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26576745/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com