Status file and log file tip: the MySQL data directory also contains many status files and log files whose names are named after the host name and related suffixes.
The MySQL data directory contains many status files and log files whose names are named by the host name and related suffixes.
The following is a description list of these files:
Table 3.1. status files and log files
File type default name file content
Process ID file hostname. pid MySQL server process ID
General query logs hostname. log connection/disconnection events and query information
Slow query log hostname-slow.log records command information that has been queried for a long time
Change the log hostname. nnn to create or modify the query command information for the data table structure and content
Binary representation of query commands that create or modify data table structures and content in the binary change log hostname-bin.nnn
Binary change log index file hostname-bin.index in use binary change log list
The error log hostname. err records the "start/stop" events and exceptions.
The change log and binary change log are mainly used for the crash recovery of the MySQL database server. because the change log records all changes to the database, event replay can be performed. For more information, see the relevant database backup and recovery section. For change logs, we can use the -- log-long-format option to allow it to record related events in an extended manner. Extended Mode can record who sends the query and when the query is sent. This allows us to better understand the operations of the client. The log records all the operations of the query command, which may contain some sensitive information. Therefore, we need to ensure the security of log files.