内置数据库“information_schema"未在用户创建的数据库中记录表的最后更新时间

In-built database quot;information_schemaquot; not logging the last update time of a table in user created database(内置数据库“information_schema未在用户创建的数据库中记录表的最后更新时间)
本文介绍了内置数据库“information_schema"未在用户创建的数据库中记录表的最后更新时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

内置数据库 information_schematables 表不会将用户创建的数据库中的表的活动记录为字段 table_schematable_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"未在用户创建的数据库中记录表的最后更新时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

Execute complex raw SQL query in EF6(在EF6中执行复杂的原始SQL查询)
Hibernate reactive No Vert.x context active in aws rds(AWS RDS中的休眠反应性非Vert.x上下文处于活动状态)
Bulk insert with mysql2 and NodeJs throws 500(使用mysql2和NodeJS的大容量插入抛出500)
Flask + PyMySQL giving error no attribute #39;settimeout#39;(FlASK+PyMySQL给出错误,没有属性#39;setTimeout#39;)
auto_increment column for a group of rows?(一组行的AUTO_INCREMENT列?)
Sort by ID DESC(按ID代码排序)