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"未在用户创建的数据库中记录表的最后更新时间


- SQL 临时表问题 2022-01-01
- 如何将 SonarQube 6.7 从 MySQL 迁移到 postgresql 2022-01-01
- 如何将 Byte[] 插入 SQL Server VARBINARY 列 2021-01-01
- 使用 Oracle PL/SQL developer 生成测试数据 2021-01-01
- 以一个值为轴心,但将一行上的数据按另一行分组? 2022-01-01
- 远程 mySQL 连接抛出“无法使用旧的不安全身份验证连接到 MySQL 4.1+"来自 XAMPP 的错误 2022-01-01
- 导入具有可变标题的 Excel 文件 2021-01-01
- 如何使用 pip 安装 Python MySQLdb 模块? 2021-01-01
- 更改自动增量起始编号? 2021-01-01
- 在SQL中,如何为每个组选择前2行 2021-01-01