Debian / Ubuntu MySQL Error Log File Location

In Debian and Ubuntu, the MySQL error log file is usually located at /var/log/mysql/error.log.

To view the contents of the error log file, you can use the less command in the terminal:

sudo less /var/log/mysql/error.log

This will display the contents of the error log file in the terminal. You can use the arrow keys to scroll up and down, and press the “q” key to exit the less viewer.

Note that the location of the MySQL error log file may be different if you have customized the MySQL configuration. In that case, you can check the my.cnf configuration file for the log_error option to see where the error log file is located:

sudo vi /etc/mysql/my.cnf

In the [mysqld] section of the file, you should see a line like this:

log_error = /var/log/mysql/error.log

This line specifies the location of the error log file. If it is different from the default location, you can use the less command to view the contents of the file at the new location.

Leave a Comment