View the location of the mysql log file on the linux server

Log in to the mysql terminal
mysql -uroot -p and
enter the password:
enter mysql>

1. 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)

2. 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)

3. 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)

Guess you like

Origin blog.csdn.net/qq_46480020/article/details/111656457