MySQL Log File Location on Redhat/CentOS Linux Server
MySQL Log File Location on a Redhat/CentOS/Fedora Linux Server
MySQL log file on Redhat/CentOS Server : /var/log/mysqld.log
On some servers mySQL logs might be in a different location. Do the below steps to find out mySQL log file location if you didn’t see the logs in the above default location.
Log into your Linux Server via SSH as root and run the below command to check the mySQL error log file location. The error log and mySQL general log might be already set in the my.cnf file. Run the command “cat my.cnf” to view the content of mySQL configuration file. Do the below steps if you didn’t see any log file location set in my.cnf file.
| log_error | /var/lib/mysql/server.err
On the above server mySQL error logs are saved in the file /var/lib/mysql/server.err
Type the below command to check the mySQL general_log_file location.
| general_log_file | /var/lib/mysql/server.log
On my server mySQL error log files and general log file are saved in the above location.
Run the below command to check the slow query log location on Redhat Server.
| slow_query_log_file | /var/lib/mysql/server-slow.log