Tags: Database sql MySQL DBAwith most relationship types database, log files are an important part of the MySQL database. MySQL has several different log files, usually including error log files, binary logs, generic logs, slow
Tags: SQL statement ASE log HTTP Query general table variables SSL Opening the general log will log all SQL statements that arrive at MySQL server. Generally does not open the function, because the amount of log can be very large.
$ Master_ssl_verify_server_cert:noPanax NotoginsengLast_io_errno:1236
-Last_io_error:got Fatal Error1236 fromMaster when reading data fromBinary log:'Could not find first log file name in binary log index file'
theLast_sql_errno:0
+ Last_sql_error: A Replicate_ignore_server_ids: theMASTER_SERVER_ID: +
+master_uuid:e4a43da7-5b58-11e5-a12f-00163e003632 -Maste
' or nid in (11,22,33); REF Find one or more values based on an index SELECT * from tb1 WHERE name = ' seven '; Eq_ref Use primary key or unique type when connecting Select Tb2.nid,tb1.name from TB2 left join tb1 on tb2.nid = Tb1.nid; CONST Constant The table has a maximum of one matching row, because only one row, the column values in this row can be considered constants by the remainder of the optimizer, and the const table is fast because they are read only once. Select Nid from tb1 where
, or stop information.2. general query logs, all SQL statements or MySQL commands run by the MySQL service instance.3. binary logs: All update statements executed on the database, excluding select and show statements.4. slow query log (slow), SQL statement with execution tim
shortcomings.
D. The binlog_format operation can be performed at the global and session levels to ensure normal replication of slave databases.
3. log reading:
A. mysqlbinlog tool
4. Log deletion:
A. reset master. all binlog logs can be deleted.
B. purge master logs to 'MySQL-bin. * 'will delete all logs before *.
C. purge master logs before 'yyyy-mm-dd hh24: mi
|
| innodb_autoextend_increment | 8 |
| innodb_autoinc_lock_mode| 1 |
| sql_auto_is_null| OFF |
+-----------------------------+-------+
7 rows in set (0.00 sec) 2. We see that autocommit is turned on and we set it to off mysql> set global autocommit=OFF;
Query OK, 0 rows affected (0.00 sec) 3. Check if it is off, if it is not turned off, log back in again to vi
|+ ------------------ + ----------- +21 rows in set (0.03 sec)
Delete bin-log (delete all binary log files before mysql-bin.000018)
The Code is as follows:
Mysql> purge binary logs to 'mysql-bin.20.18 ';
Tags: mysqlMySQL enable log, view Log MYSQLEnable logging[Email protected]]# whereis My.ini[[Email protected]]# vi/etc/my.cnf[MySQLDdatadir=/var/lib/MySQLsocket=/var/lib/MySQL/MySQL. SockUser=MySQL# Default to using old password format for compatibility withMySQL3.x# clients
intvar SET insert_id=3/*!*/;
# at the #121015 16:36:51 server ID 1 end_log_pos 309 Query thread_id=2 exec_time=0 error_code=0 use test/*!*/;
SET timestamp=1350290211/*!*/;
Insert into Bin (name) values (' Xishizhaohua ')/*!*/;
# at 309 #121015 16:36:51 server ID 1 end_log_pos 336 Xid = commit/*!*/;
# at 336 #121015 16:37:25 Server ID 1 end_log_pos 379 Rotate to mysql_bin.000002 pos:4;
# End of log fi
operations write binary logs when the transaction is completed. before the transaction is committed, the write operations executed will be cached until the entire transaction is completed, the mysqld process writes the entire transaction to the binary log.When a transaction starts, content space is allocated according to the value specified by the binlog_cache_size system variable. If the specified binlog_cache_size cache space is insufficient, the transaction operation is rolled back and a mes
As an important means of querying problems, log should be recorded as much as possible for you to query some problems. MySQL has the following types of logs:-log-err query log:-log slow
Tags: let edit slow diff cannot pwd admin open closeThis article "My MySQL Learning experience (15)" will explain the MySQL log The logs in MySQL are divided into 4 categories, and using these log files, you can see what's happening inside
to MySQL server during query (server_errno = 2013)110714 6:55:28 [Note] Slave I/O thread: Failed reading log event, reconnecting to retry, log 'mysql-bin.000046' at postion 297414128110714 13:33:31 [ERROR] MYSQL_slave: Out of memory (Needed 808236 bytes)110714 13:33:31 [ERR
host_tbl3HeroAttribute_tbl4271HeroJuedi_table0ItemMarket_tbl0Item_tbl486LadderData_tbl0LadderPlayer_tbl3616LadderRankList_tbl0Mission_tbl4281MysteryShop_tbl4279PlayerStatistics_tbl0Player_tbl4282RuneScapeRecovery_tbl10Skill_tbl15SkyLadderFightingPosition_tbl3744TipsMsg_tbl0Treasure_tbl4274
Here we can see that the table UserRuneScape is executed many times.
Analyze the bin-log File ----- execution time analysis
Let's take a look at the text format
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.