Home >Database >Mysql Tutorial >Where is the mysql error log?
Mysql error log is generally in the data directory under the installation directory. It is a file with the extension ".err". The search method: 1. Log in to mysql; 2. Execute the "SHOW VARIABLES LIKE 'log_error'" command You can get the path of the error log file.
The operating environment of this tutorial: windows7 system, mysql8 version, Dell G3 computer.
The Error Log is the most commonly used log in MySQL. It mainly records information during the startup and stop process of the MySQL server, failures and exceptions that occur during the operation of the server, etc.
Mysql error log location
Under windows, the error log file is generally in the data directory under the installation directory. The file extension is .err. You can also open the my.ini file in the installation directory to check it.
How to find the error log (get the path)
1. Log in to mysql
Connect to the MySQL database server
C:\Users\Administrator>mysql -u root -p
2 . You can view the directory and file name information of the error log file through the SHOW command.
mysql> SHOW VARIABLES LIKE 'log_error'; +---------------+----------------------------------------------------------------+ | Variable_name | Value | +---------------+----------------------------------------------------------------+ | log_error | C:\ProgramData\MySQL\MySQL Server 5.7\Data\LAPTOP-UHQ6V8KP.err | +---------------+----------------------------------------------------------------+ 1 row in set, 1 warning (0.04 sec)
It can be seen that the installation path of my mysql is "C:\ProgramData\MySQL\MySQL Server 5.7\", so the error log file is in "C:\ProgramData\MySQL\MySQL Server 5.7\Data \"Down.
[Related recommendations: mysql video tutorial]
The above is the detailed content of Where is the mysql error log?. For more information, please follow other related articles on the PHP Chinese website!