MySQL | View log log

1. Go to mysql

1 MySQL -u user name -p password

 

2. Turn on the log

1 et global general_log=on;

 

3. Check the mysql log file path

1 show variables like 'general_log_file';

 

4. Check the log file in the terminal ( suggesting insufficient permissions to use the super administrator privileges preceded by sudo)

1 tail -f file path

 

Note:

tail: view the contents of the file 
-f: read cycle, the contents of the trace file changes will be updated real-time display

 

Guess you like

Origin www.cnblogs.com/ykit/p/11781080.html