我用的是debian系统。分区已满后,我无法启动 mysql - 我收到消息“错误:/var/lib/mysql 分区太满!”
我发现建议删除 /var/lib/mysql 中一些我不需要的数据文件夹,因此我删除了我不需要的旧数据库的文件夹。
现在,当我尝试再次启动 mysqld 服务时,收到以下错误:
150218 10:09:03 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
150218 10:09:03 [Warning] Using unique option prefix key_buffer instead of key_buffer_size is deprecated and will be removed in a future release. Please use the full n$
150218 10:09:03 [Warning] Using unique option prefix myisam-recover instead of myisam-recover-options is deprecated and will be removed in a future release. Please use$
150218 10:09:03 [Note] Plugin 'FEDERATED' is disabled.
150218 10:09:03 InnoDB: The InnoDB memory heap is disabled
150218 10:09:03 InnoDB: Mutexes and rw_locks use GCC atomic builtins
150218 10:09:03 InnoDB: Compressed tables use zlib 1.2.7
150218 10:09:03 InnoDB: Using Linux native AIO
150218 10:09:03 InnoDB: Initializing buffer pool, size = 128.0M
150218 10:09:03 InnoDB: Completed initialization of buffer pool
150218 10:09:03 InnoDB: highest supported file format is Barracuda.
InnoDB: Log scan progressed past the checkpoint lsn 20417554120
150218 10:09:03 InnoDB: Database was not shut down normally!
InnoDB: Starting crash recovery.
InnoDB: Reading tablespace information from the .ibd files...
InnoDB: Restoring possible half-written data pages from the doublewrite
InnoDB: buffer...
InnoDB: Doing recovery: scanned up to log sequence number 20419913007
150218 10:09:03 InnoDB: Error: page 24667 log sequence number 20425339296
InnoDB: is in the future! Current system log sequence number 20419913007.
InnoDB: Your database may be corrupt or you may have copied the InnoDB
InnoDB: tablespace but not the InnoDB log files. See
InnoDB: http://dev.mysql.com/doc/refman/5.5/en/forcing-innodb-recovery.html
InnoDB: for more information.
150218 10:09:03 InnoDB: Error: page 530914 log sequence number 20426394124
InnoDB: is in the future! Current system log sequence number 20419913007.
InnoDB: Your database may be corrupt or you may have copied the InnoDB
InnoDB: tablespace but not the InnoDB log files. See
InnoDB: http://dev.mysql.com/doc/refman/5.5/en/forcing-innodb-recovery.html
InnoDB: for more information.
InnoDB: 1 transaction(s) which must be rolled back or cleaned up
InnoDB: in total 6135 row operations to undo
InnoDB: Trx id counter is 574E00
150218 10:09:04 InnoDB: Starting an apply batch of log records to the database...
InnoDB: Progress in percents: 150218 10:09:04 InnoDB: Error: page 248000 log sequence number 20425331738
InnoDB: is in the future! Current system log sequence number 20419913007.
InnoDB: Your database may be corrupt or you may have copied the InnoDB
InnoDB: tablespace but not the InnoDB log files. See
InnoDB: http://dev.mysql.com/doc/refman/5.5/en/forcing-innodb-recovery.html
我看到我应该启动 mysql,同时向 my.cnf 添加以下命令 innodb_force_recovery = 1/2/3/4/5/6 从 1 开始,向上。
尝试了所有这些,但一无所获。
有人有什么想法吗?
答案1
当 /var/lib/mysql 填充 /root 时,我遇到了非常类似的问题。看一下https://dba.stackexchange.com/questions/91575/moved-mysql-datadir-now-server-will-not-run 使用符号链接,因为各种配置文件中隐藏着如此多的路径,因此很难追踪它们。
答案2
通过删除整个数据库目录,您的系统会变得不一致:最有可能的是,您仍然在“ibdata *”和“ib_logfile *”中引用了该数据库(假设该数据库中有InnoDB表)。
错误消息“日志序列号是将来的”是类似不一致的另一个迹象。
您可以尝试使用“innodb_force_recovery”(使其只读)启动MySQL服务器,然后使用“mysqldump”获取数据,将它们存储在其他地方。然后删除数据库文件(可能是“/var/lib/mysql/data”下面的所有内容)并安装一个新的空 MySQL 实例(“mysql_install_db”),将转储加载到其中。由于这些不一致,这可能包括数据丢失。
不要忘记设置对磁盘空间的监控!