我试图运行以下语句,希望创建两个现有表的联接。
create table CRS_PAIR
select concat_ws(',', a.TESTING_ID, b.TRAINING_ID, a.TESTING_C) as k, concat_ws(',', a.YTG, b.YTG) as YTG
from CRS_TESTING a, CRS_TRAINING b
where a.TESTING_C=b.TRAINING_C;目前,这两个表的大小如下:
mysql> SELECT table_name, round(((data_length + index_length) / (1024*1024)),2) as "size in megs" FROM information_schema.tables WHERE table_schema = "crs";
+----------------+---------------+
| table_name | size in megs |
+----------------+---------------+
| CRS_TESTING | 36.59 |
| CRS_TRAINING | 202.92 |
+----------------+---------------+经过一天多一点的时间,查询完成了,我得到了以下结果。
140330 2:53:50 [ERROR] /usr/sbin/mysqld: The table 'CRS_PAIR' is full
140330 2:53:54 InnoDB: ERROR: the age of the last checkpoint is 9434006,
InnoDB: which exceeds the log group capacity 9433498.
InnoDB: If you are using big BLOB or TEXT rows, you must set the
InnoDB: combined size of log files at least 10 times bigger than the
InnoDB: largest such row.结果表明,/var/lib/mysql的大小在磁盘空间中已经增长到246 in,磁盘空间不足。但是,由于某种原因,CRS_PAIR表没有显示在shell中。即使我试图得到所有数据库的大小。
mysql> SELECT table_schema "Data Base Name", sum( data_length + index_length ) / (1024 * 1024) "Data Base Size in MB" FROM information_schema.TABLES GROUP BY table_schema ;
+--------------------+----------------------+
| Data Base Name | Data Base Size in MB |
+--------------------+----------------------+
| crs | 1426.4531 |
| information_schema | 0.0088 |
| mysql | 0.6453 |
| performance_schema | 0.0000 |
+--------------------+----------------------+
4 rows in set (0.74 sec)这是“显示表”命令。
mysql> show tables;
+----------------+
| Tables_in_crs |
+----------------+
| CRS_TESTING |
| CRS_TRAINING |
some other tables
+----------------+
9 rows in set (0.00 sec)CRS_PAIR不在那里。
请问是否有人能帮我弄清楚这张神秘的桌子到哪里去了,这样我就可以清理我的磁盘空间了?
发布于 2014-03-31 00:33:51
如果您没有设置innodb_file_per_table (或设置为0),那么InnoDB将把所有InnoDB表放入池文件(通常是/var/lib/mysql/ibdata1),根据需要将其展开以适应书面数据。然而,引擎从来没有做任何空间回收。这意味着ibdata1文件总是在增长,永远不会缩小。
缩小此文件大小的唯一方法是备份数据、关闭MySQL、删除它、重新启动MySQL,然后重新加载数据。
https://stackoverflow.com/questions/22751740
复制相似问题