Log in to MySQL terminal
Log file path
Mysql> Show variables like ' general_log_file ';
+------------------+------------------------------------+
| variable_name | Value |
+------------------+------------------------------------+
| General_log_file | /usr/local/mysql/data/localhost.log |
+------------------+------------------------------------+
1 row in Set (0.00 sec)
Error log file path
Mysql> Show variables like ' log_error ';
+---------------+------------------------------------+
| variable_name | Value |
+---------------+------------------------------------+
| Log_error | /usr/local/mysql/data/localhost.err |
+---------------+------------------------------------+
1 row in Set (0.00 sec)
Slow query log file path
Mysql> Show variables like ' slow_query_log_file ';
+---------------------+-----------------------------------------+
| variable_name | Value |
+---------------------+-----------------------------------------+
| Slow_query_log_file | /usr/local/mysql/data/localhost-slow.log |
+---------------------+-----------------------------------------+
1 row in Set (0.01 sec)
How to view the MySQL log file location