mysql table full 的解决方案

发现执行mysql的 REPLACE INTO 的时候mysql返回 #1114 - The table ‘xxxx’ is full
这个错误。。。
以前没有遇到过,于是查找资料解决这个问题。。。

得知是由于内存表的大小超过了规定的范围,于是搜索解决方法,
网上提到的有两种解决方法,
一种是修改tmp_table_size参数,另外一种是修改max_heap_table_size参数。。。

[root@localhost etc]# vi /etc/rc.d/init.d/mysql
找到
$bindir/mysqld_safe --datadir=$datadir --pid-file=$pid_file >/dev/null 2>&1 &
修改为
$bindir/mysqld_safe --datadir=$datadir --pid-file=$pid_file -O tmp_table_size=64M -O max_heap_table_size=32M >/dev/null 2>&1 &

重启mysql
[root@localhost etc]# /usr/bin/mysqladmin -u root -p shutdown
Enter password:
[root@localhost etc]# /etc/init.d/mysql start
[root@localhost etc]# mysql

查看是否己修改

mysql> show variables like '%max_heap_table_size%';
+---------------------+----------+
| Variable_name       | Value    |
+---------------------+----------+
| max_heap_table_size | 33553408 |
+---------------------+----------+
1 row in set (0.00 sec)

mysql> show variables like '%tmp_table_size%';
+----------------+----------+
| Variable_name  | Value    |
+----------------+----------+
| tmp_table_size | 67108864 |
+----------------+----------+
1 row in set (0.00 sec)

己经修改成功!
注意:修改参数值是按照M单位来计算的。。。

你可能感兴趣的:(mysql)