Home  >  Article  >  Operation and Maintenance  >  Where are the MySQL logs in Linux?

Where are the MySQL logs in Linux?

angryTom
angryTomOriginal
2020-03-11 10:54:1612144browse

Where are the MySQL logs in Linux?

Where are the MySQL logs in Linux?

The MySQL logs in Linux are generally saved in the /var/log/ directory , but you need to look at the specific configuration file to determine. The specific method is as follows:

1. First log in to mysql:

>mysql -u root -p

2. Then check whether it is enabled. Log (recommended learning: Linux video tutorial)

mysql>show variables like 'log_%';

3. View the current log

mysql> show master status;

4. The mysql log type you need to know:

Error log: -log-err

Query log: -log

Slow query log: -log-slow-queries

Update log: - log-update

Binary log: -log-bin

5. Modify the configuration/etc/my.cnf (the following is the log file storage location)

[mysqld]
log=/var/log/mysqld_common.log
log-error=/var/log/mysqld_err.log
log-bin=/var/log/mysqld_bin.bin

For more Linux operation and maintenance related tutorials, please pay attention to PHP中文网!

The above is the detailed content of Where are the MySQL logs in Linux?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn