Location of MySQL Log File in Linux

Wondering where are the MySQL log files located on a linux system? It depends upon the flavor of linux you are using.

For Fedora Linux, CentOS or plain Red Hat system, the MySQL log files are located at the default location of log files, that is, /var/log/ directory. The name of the file is mysqld.log.

If you are on Ubuntu/Debian system, then its located at the same location, /var/log/, but the name of the log file is mysql.log.

If you are on FreeBSD, then you can find the mysql log file in the /var/db/mysql/ directory. The log file name would be yourhostname.err.

To open the MySQL log file on terminal, you can use the following series of command, depending upon your requirements

tail -f /var/log/mysql.log
less /var/log/mysql.log
grep ‘something’ /var/log/mysql.log

Leave a Comment