"Go" [MySQL] Linux MySQL log special

Source: Internet
Author: User

Original link: http://blog.csdn.net/xiaoxu0123/article/details/6258538

1. Set the directory to be stored:

[Email protected] etc]# MORE/ETC/MY.CNF
[Mysqld]
# # #此处省略N个字
Log-error=/var/log/mysql/mysql_error.log #错误日志
Log=/var/log/mysql/mysql.log # # #最好注释掉, generates a lot of logs, including changes to each SQL and environment variables that are executed, etc.
Log-bin=/var/log/mysql/mysql_bin.log # for backup recovery, or master-slave replication. View and clear method, see another text of this blog Binlog
Log-slow-queries=/var/log/mysql/mysql_slow.log #慢查询日志

[Mysqld_safe]
Log-error=/var/log/mysql/mysqld.log
Pid-file=/var/run/mysqld/mysqld.pid

2, need to restart MySQL after configuration

[Email protected] etc]#/etc/init.d/mysqld restart

3. View log:

General Log View:

[[email protected] mysql]# ls
mysql_bin.000001 mysql_bin.index mysqld.log mysql_error.log mysql.log mysql_slow.log

Use cat or more *.log to view normal logs

"Go" [MySQL] Linux MySQL log special

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.