【发布时间】:2017-11-15 13:22:54
【问题描述】:
我使用的软件使用的是 MySQL 服务器(版本 5.0.52)。 一些数据库是动态创建的,我需要列出这些数据库的名称(标准是包含 2 个具有不同特定名称的表的数据库)。因此,我在 information_schema 上使用 mysql 查询来查找我需要的内容:
SELECT distinct T.table_schema
FROM information_schema.`TABLES` T
inner join information_schema.`TABLES` T2
on T2.table_schema = T.table_schema
where T.table_schema like 'myBase_%'
and T.table_name like '%\_1'
and T2.table_schema like 'myBase_%'
and T2.table_name = 'myTable'
MySQL 服务需要每 2 或 3 周手动重新启动一次,因为某些表似乎已崩溃或锁定。来自 pid3306_crash.err 的错误消息(这是第一个错误,但是一旦我有了这一行,软件尝试查询的每个表都会出现此错误,给我 5000 行“找不到文件”):
[ERROR] D:\MySQL\MySQL Server 5.0\bin\mysqld-nt: Cannot find the file: '.\myBase_56320\petiquettes_k_1.frm' (Errcode: 22)
我为这个 mysql 实例启用了完整的日志,唯一可以访问这个表的 mysql 查询是我引用的那个。没有与上面引用的第一个错误相关的任何其他查询。 所以我的问题是:关于 information_schema 的查询是否有可能使我的基础崩溃,或者我应该看看其他地方吗?
谢谢。
【问题讨论】: