sissiyam 发表于 2010-7-27 16:19:59

求助:如何知道MySQL数据库中哪些表是没有使用的

因为数据库越来越大,想删掉一些没有使用的表

kider 发表于 2010-7-27 17:43:49

方法1、show table status 中看Update_time时间(MyISAM引擎适用)。
如:mysql> show table status like 'tb2'\G
*************************** 1. row ***************************
         Name: tb2
         Engine: MyISAM
      Version: 10
   Row_format: Fixed
         Rows: 1
Avg_row_length: 17
    Data_length: 17
Max_data_length: 4785074604081151
   Index_length: 1024
      Data_free: 0
Auto_increment: NULL
    Create_time: 2010-07-27 17:29:15
    Update_time: 2010-07-27 17:29:15
   Check_time: NULL
      Collation: utf8_general_ci
       Checksum: NULL
Create_options:
      Comment:
1 row in set (0.01 sec)

方法2、看磁盘上数据文件、索引文件被修改的时间。

方法3、自己写个监控的东东统计...

sissiyam 发表于 2010-7-28 10:04:35

谢谢kider,如果只是看更新时间还不够准确啊,有些不只被查询不被更新呢,怎么办?

请赐教啊,谢谢啦!
页: [1]
查看完整版本: 求助:如何知道MySQL数据库中哪些表是没有使用的