I've just been caught by the same problem.
Restoring a backup from a master server running: Percona-Server-server-51-5.1.50-rel11.4.111.rhel5 onto a slave server running the same.
The db restores correctly, but the /mysql/slow_log.CSV and /mysql/slow_log.CSM files did not come across as part of the restore.
When I went to enable slow logging on the new slave, I received the following error:
mysql> set global slow_query_log = 1; ERROR 13 (HY000): Can't get stat of './mysql/slow_log.CSV' (Errcode: 2) mysql>
However, my slow log configuration is (and always has been):
| slow_query_log | OFF | | slow_query_log_file | /var/lib/mysql/sqls05-slow.log |
I have never configured the server to use TABLES for the slow log, nor have I used a mysql or percona version that defaulted to TABLE output.
For some reason mysql requires the slow_log.CSV table to be around even in order to enable slow logging to a file.
Copying the slow_log.CSV and slow_log.CSM tables into place on the new server allowed me to enable slow logging.
(The same issue may also impact the general_log table - it is also an automatically created CSV table. I don't use it so cannot confirm the impact).
Andrew
I've just been caught by the same problem.
Restoring a backup from a master server running: Percona- Server- server- 51-5.1. 50-rel11. 4.111.rhel5 onto a slave server running the same.
The db restores correctly, but the /mysql/slow_log.CSV and /mysql/slow_log.CSM files did not come across as part of the restore.
When I went to enable slow logging on the new slave, I received the following error:
mysql> set global slow_query_log = 1; slow_log. CSV' (Errcode: 2)
ERROR 13 (HY000): Can't get stat of './mysql/
mysql>
However, my slow log configuration is (and always has been):
| slow_query_log | OFF | mysql/sqls05- slow.log |
| slow_query_log_file | /var/lib/
I have never configured the server to use TABLES for the slow log, nor have I used a mysql or percona version that defaulted to TABLE output.
For some reason mysql requires the slow_log.CSV table to be around even in order to enable slow logging to a file.
Copying the slow_log.CSV and slow_log.CSM tables into place on the new server allowed me to enable slow logging.
(The same issue may also impact the general_log table - it is also an automatically created CSV table. I don't use it so cannot confirm the impact).
Andrew