# mysql mysql> set @@global.tmp_table_size=327680000; Query OK, 0 rows affected (0.00 sec) mysql> exit # mysql mysql> show variables like '%tmp%'; +-------------------+-----------+ | Variable_name | Value | +-------------------+-----------+ | max_tmp_tables | 32 | | slave_load_tmpdir | /tmp | | tmp_table_size | 327680000 | | tmpdir | /tmp | +-------------------+-----------+ 4 rows in set (0.00 sec) mysql>
old value
set @@global.tmp_table_size=134217728; set @@global.max_heap_table_size=268435456;
512Mb
set @@global.tmp_table_size=536870912; set @@global.max_heap_table_size=536870912;
Создаем файлик /etc/logrotate.d/mysqld:
/var/log/mysqld/*.log { create 664 mysql mysql notifempty daily rotate 10 missingok compress postrotate if test -n "`ps acx|grep mysqld`"; then /usr/bin/mysqladmin flush-logs fi endscript }
Обязательно запускаем один раз
logrotate -f /etc/logrotate.d/mysqld