Where are the MySQL logs in Linux?

angryTom
Release: 2020-03-11 10:54:16
Original
12155 people have browsed it

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
Copy after login

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

mysql>show variables like 'log_%';
Copy after login

3. View the current log

mysql> show master status;
Copy after login

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
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!