mysql information_schema tables update_time

2023-07-24

mysql information_schema tables update_time

1、
select update_time from information_schema.`TABLES` where table_schema = 'cms' and table_name = 'user'

2、

export MYSQL_PWD=password
host=127.0.0.1
user=user
mysql -h ${host} -P3306 -u ${user} -Dinformation_schema -e"select table_name,data_length,index_length,update_time from tables where table_schema='easyliao_crm' order by data_length";

3、默认24小时更新一次
mysql> show variables like 'info%';
+---------------------------------+-------+
| Variable_name | Value |
+---------------------------------+-------+
| information_schema_stats_expiry | 86400 |
+---------------------------------+-------+

4、InnoDB引擎下更新记录会有延迟,修改为0。

set session information_schema_stats_expiry=0;
set global information_schema_stats_expiry=0;

分类:数据库 | 标签: |

相关日志

评论被关闭!