Wednesday, June 5, 2013

MySQL flush logs; gives: ERROR 1105 (HY000): Unknown error

If you trying to run "flush logs;" from mysql or with mysqladmin you'll get following error message:
ERROR 1105 (HY000): Unknown error

There are bugs that might affect like this but usually first thing to do with this is check log paths permissions.

1. First check what log directories your MySQL is using:
mysql> show global variables like '%log%';

You can also use more specific checks like:
This show error log:
mysql> show global variables like '%err%';
or for general log:
mysql> show global variables like '%general%';
or for slow log:
mysql> show global variables like '%slow%';


For example:

mysql> show global variables like '%err%';
+--------------------+----------------------+
| Variable_name      | Value                |
+--------------------+----------------------+
| error_count        | 0                    |
| log_error          | /data/mysql/logs/mysqld_error.log |
| max_connect_errors | 10                   |
| max_error_count    | 64                   |
| slave_skip_errors  | OFF                  |
+--------------------+----------------------+
5 rows in set (0.00 sec)



2. After you know log paths check that mysql user (or user that run mysqld if it is other than mysql.) have permissions to write in those directories (remember to check all log paths you are using).

ls -latr /data00/mysql/

drwxr-xr-x 14 mysql mysql 4096 Mar 26 06:46 logs

If there is not enough permissions then add them and the error is gone. If permissions are correct then you are probably hitting the bug.

No comments:

Post a Comment