How to view mysql log files in centos

王林
Release: 2020-05-18 11:44:30
Original
8009 people have browsed it

How to view mysql log files in centos

Mysql does not allow us to view the log by default, so we need to change some settings to view it.

1. Change the configuration file and allow users to view the log file

sudo vi /etc/mysql/mysql.conf.d/mysqld.cnf
Copy after login

Delete the # in front of lines 68 and 69

2. Restart the mysql service

sudo service mysql restart
Copy after login

3. Enter the /var/log/mysql/ directory

cd /var/log/mysql/
Copy after login

You can view the mysql log files in this directory.

Always check the log file command: When the log changes, you can always see it in the terminal

sudo tail -f /var/log/mysql/mysql.log
Copy after login

Recommended tutorial: centos tutorial

The above is the detailed content of How to view mysql log files in centos. 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!