MySQL Log Management Learning notes

Source: Internet
Author: User

SHOW GLOBAL VARIABLES like '%log% '


Error log: Information in the server startup or shutdown process

Error message during server run

Information generated when the event Scheduler runs an event

Information generated from the server process when it is started from the server

Log_error

Log_warnings


General Query log:

General_log

General_log_file

log_output={table| file| Noen}


Slow query log: Query time exceeds a specified time log

Long_query_time specified time-out

log_slow_query={on| OFF}

Slow_query_log

Slow_query_log_file

Start slow query log: SET GLOBAL slow_query_log=1;

The change log file must edit the configuration file and restart the server, simply hit


Open and close to operate directly


Binary log: Any operation that causes or may cause changes to the database (DDL,DML)


Replication, Instant Point recovery


Binary log format:

Statement based: statement

Row-based: row

Mixing mode: Mixed

Binary Log events:

Time of Generation

Relative position

Binary log files:

Index file

Binary log files

To view the binary log files that are currently in use

Mysql>show MASTER STATUS;

To view supported binary log files

Mysql>show BINARY LOGS;

viewing binary log files

Mysql>show BINLOG EVENT in ' binary log


File name ' [from POS];

Clear the previous log file

Mysql>purge BINARY LOGS to ' log file '

Manual scrolling of binary log files

Mysql>flush LOGS;

Mysqlbinlog: Tool to read statements from binary logs:

--start-datetime

--stop-datetime


--start-position

--stop-position

Relay log: From the server, copy from the binary log file of the primary server and


To the event, and save the log file as


Transaction log: The transactional storage engine is used to ensure atomicity, consistency, isolation,


Durability.

Innodb_flush_log_at_trx_commit:

0: Synchronize every second and perform a disk flush operation

1: Each thing synchronizes and performs a disk flush operation

2: Everything is synchronized, no disk flush operation is performed


Storage Engine:

MyISAM:. frm. MYD. MYI

Does not support things, only table locks are supported, foreign keys are not supported, support B


Tree index, fulltext Index, spatial index, support table compression

InnoDB:. frm. ibd

Support for things, row-level locks, support for B-tree indexes, clustered indexes,


Adaptive hash index, table space, raw disk device (bare device)


This article is from the "Godben" blog, make sure to keep this source http://godben.blog.51cto.com/8919725/1695170

MySQL Log Management Learning notes

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.