MySQL 5.1 problem slow_log – Errcode: 2

MySQL

 

MySQL 5.1 problem slow_log – Errcode: 2

 

Jeżeli po aktualizacji czy włączeniu slow_log na serwerze MySQL pojawi się coś podobnego do tego:

Error : Can't get stat of './mysql/slow_log.CSV' (Errcode: 2)
 Error : Out of memory; check if mysqld or some other process uses all available memory; if not, you may have to use 'ulimit' to allow mysqld to use more memory or you can add more swap space
mysql> set global slow_query_log=ON;
ERROR 13 (HY000): Can't get stat of './mysql/slow_log.CSV' (Errcode: 2)

Należy wyłączyć slow log:

mysql> set global slow_query_log=0;
 Query OK, 0 rows affected (0.00 sec)

Utworzyć brakujące pliki:

root@s:/var/lib/mysql/mysql# touch slow_log.CSV
 root@s:/var/lib/mysql/mysql# touch slow_log.CSM
 root@s:/var/lib/mysql/mysql# chown mysql:mysql slow_log.*

Włączyć slow_log:

mysql> set global slow_query_log=1;
 Query OK, 0 rows affected, 1 warning (0.06 sec)

i naprawić tabele:

mysql> repair table mysql.slow_log;
 +----------------+--------+----------+----------+
 | Table | Op | Msg_type | Msg_text |
 +----------------+--------+----------+----------+
 | mysql.slow_log | repair | status | OK |
 +----------------+--------+----------+----------+
 1 row in set (0.02 sec)

Problem rozwiązany 😉

Dodaj komentarz