In-built database quot;information_schemaquot; not logging the last update time of a table in user created database(内置数据库“information_schema未在用户创建的数据库中记录表的最后更新时间)
问题描述
内置数据库 information_schema
的 tables
表不会将用户创建的数据库中的表的活动记录为字段 table_schema
和 table_name
分别缺少用户创建的数据库和表名的值,不允许我运行 SQL 查询
The tables
table of the in-built database information_schema
does not log the activities of the tables in user created databases as the fields table_schema
and table_name
lacks the values of the user created databases and table names respectively, disallowing me to run the SQL query
SELECT update_time
FROM information_schema.tables
WHERE table_schema='my_db' and table_name='my_table';
-- For table named 'my_table' in database 'my_db'
用于检索数据库中表的最后更新时间(或更改时间)(即特定表中数据的最后一次更新、删除或插入的时间),以决定是否需要备份.
for retrieving last update time (or changed time) of a table in database (i.e. the last time when data in a specific table is updated, deleted or inserted) for deciding whether a backup is needed or not.
谁能帮我解决这个在数据库中记录活动的问题并解释一下背后的原因?
Can anyone please help me solve this problem of logging activities in database and explain me the reason behind it?
提前致谢.
推荐答案
显然您的表是 InnoDB,并且您使用的 MariaDB 版本低于 10.2.
Apparently your tables are InnoDB, and you are using MariaDB version below 10.2.
您遇到的是一个旧的 MySQL 错误(或者更确切地说是一个没有功能,正如 InnoDB 团队所设想的那样).它已在最新的稳定 InnoDB 中得到修复,该 InnoDB 包含在 MariaDB 10.2.
What you have encountered is an old MySQL bug (or rather an absence of feature, as it was envisioned by the InnoDB team). It has been fixed in the latest stable InnoDB, which is included into MariaDB 10.2.
对于 MyISAM 表,它也应该在以前的版本中工作.
For MyISAM tables it should work in previous versions too.
这篇关于内置数据库“information_schema"未在用户创建的数据库中记录表的最后更新时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:内置数据库“information_schema"未在用户创建的数据库中记录表的最后更新时间


基础教程推荐
- 带有WHERE子句的LAG()函数 2022-01-01
- CHECKSUM 和 CHECKSUM_AGG:算法是什么? 2021-01-01
- MySQL 5.7参照时间戳生成日期列 2022-01-01
- 从字符串 TSQL 中获取数字 2021-01-01
- 带更新的 sqlite CTE 2022-01-01
- while 在触发器内循环以遍历 sql 中表的所有列 2022-01-01
- ORA-01830:日期格式图片在转换整个输入字符串之前结束/选择日期查询的总和 2021-01-01
- 使用 VBS 和注册表来确定安装了哪个版本和 32 位 2021-01-01
- MySQL根据从其他列分组的值,对两列之间的值进行求和 2022-01-01
- 如何在 CakePHP 3 中实现 INSERT ON DUPLICATE KEY UPDATE aka upsert? 2021-01-01