Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have mysql server running successfully. The error log location is as..

mysql> show variables like '%log_erro%';
| Variable_name | Value                  |
| log_error     | /var/log/mysql/err.log |
1 row in set (0.00 sec)

The issue am facing is that when i am changing the error log location from above to some other location by changing from my.cnf and then restarting the server but the error log is not getting generated and servers starts successfully.


After restarting the server the value of the above variable get changed. but i didn't found the error log in that location.

share|improve this question
Hello Abdul, silly question, but did you make sure that MySQL has rights in the other location to write and read? – Craig Efrein Jan 25 '12 at 5:55
@CraigEfrein : yes the folder under which the error log is to be generated have owner:group as mysql:mysql and having correct permissions also.. – Abdul Manaf Jan 25 '12 at 6:00
@CraigEfrein : I have this problem not with all mysql servers.this is what i am facing first time i know how to change the variables from my.cnf. – Abdul Manaf Jan 25 '12 at 6:03
Well, lets say you wanted to put the error log in /opt/log/mysql for example. 1. mkdir -p /opt/log/mysql 2. chown mysql:mysql -R /opt/log/mysql 3. Edit my.cnf and change log_error to /opt/log/mysql. Make sure that log_error is under the [mysqld] section. Then restart mysql – Craig Efrein Jan 25 '12 at 6:05
@CraigEfrein : I have done all this but not found the log file. – Abdul Manaf Jan 25 '12 at 6:09
up vote 1 down vote accepted

You may have placed the log-error option under the wrong header.

Put it here:


Then, service mysql restart

I put it there because the mysql service in /etc/init.d calls mysqld_safe to call mysqld. In addition, /etc/init.d/mysql can pass paramaters to mysqld_safe as shown above.

Just to be safe, run this also

mkdir /var/log/mysql
chown -R mysql:mysql /var/log/mysql

Give it a Try !!!

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.