MySQL db 消失了如何跟踪发生了什么?

标签 mysql database roundcube

两天前我安装了 RoundCube 邮件脚本,用于:

PHP

Name        : php
Arch        : x86_64
Version     : 5.3.18
Release     : 1.el6.remi

MySQL

Name        : mysql
Arch        : x86_64
Version     : 5.5.28
Release     : 1.el6.remi

直到今天早上一切都很好,脚本指出 Round Cube 数据库有问题。我在看目录时有多奇怪:

/var/lib/mysql/roundcubemail

只有frm文件,没有任何.myd或.myi

cache.frm
cache_index.frm
cache_messages.frm
cache_thread.frm
contactgroupmembers.frm
contactgroups.frm
contacts.frm
db.opt
dictionary.frm
identities.frm
searches.frm
session.frm
users.frm

我的服务器有 12 个数据库,现在只有 Round Cube 数据库缺少 .myd .myi 文件。重新安装这个脚本不是问题,但我很想弄清楚这个数据库发生了什么,并确保它不会再次发生。

MySQL错误日志只有这个信息:

121117  7:38:06 [ERROR] Cannot find or open table roundcubemail/session from
the internal data dictionary of InnoDB though the .frm file for the
table exists. Maybe you have deleted and recreated InnoDB data
files but have forgotten to delete the corresponding .frm files
of InnoDB tables, or you have moved .frm files to another database?
or, the table contains indexes that this version of the engine
doesn't support.
See http://dev.mysql.com/doc/refman/5.5/en/innodb-troubleshooting.html
how you can resolve the problem.

我的问题是:是否有其他方法可以跟踪这种情况并找到数据库刚刚消失的原因?

最佳答案

.myd.myi 文件只存在于 MyISAM 表中。

如果您遵循标准的 Roudcube 安装程序(通过 v0.8.4 验证),表将设置为使用 InnoDB 存储引擎。

您是否弄乱了 /var/lib/mysql/ 下的任何文件?默认情况下,InnoDB 表存储在一个文件中,在您的情况下可能是 /var/lib/mysql/ibdata1。如果没有,请查找 innodb_data_file_path my.cnf 配置文件中的指令。

关于MySQL db 消失了如何跟踪发生了什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13559929/

相关文章:

storage - 圆形立方体问题 : connection to storage server failed

php - Roundcube 自定义 SMTP_USER 变量

java - 使用公网IP远程访问MySQL数据库出错

mysql - 仅在逗号 mysql 后存储数字

php - 当 mysql 中存在 unicode 字符时,无法将条目存储为字符串

database - SQL Server 2008 CPU 使用率高

MySQL `BEFORE INSERT TRIGGER` 条件下如何跳过数据插入?

php - 将csv文件上传并导入到mysql中的多个表中

c# - 无法将嵌套关系或元素列添加到包含 SimpleContent 列的表

php - 在 nginx 上安装 roundcube 会导致 HTTP ERROR 500