All Linux HowTo's

How to find where MySQL puts error logs

MySQL will use the “/etc/my.cf” file to learn where to put its error log file. However, if you don’t specify it, you don’t have access to the filesystem or you’re simply confused, try this. First log into MySQL and then run the following:

mysql> show global variables like 'log_error';
+---------------+--------------------------------------+
| Variable_name | Value                                |
+---------------+--------------------------------------+
| log_error     | /var/lib/mysql/this.server.local.err |
+---------------+--------------------------------------+
1 row in set (0.00 sec)

You can see from the above that MySQL is logging to “/var/lib/mysql/this.server.local.err”.

Share This:

Leave a Reply

Your email address will not be published. Required fields are marked *