首页 > 代码库 > 关于mysql的ddl_log.log文件
关于mysql的ddl_log.log文件
今天在mysql数据库的data目录下发现了这样的一个log文件
ddl_log.log 于是官网查看了一下,英文好的可以自己阅读一下,不好的就麻烦了:(
The DDL Log
The DDL log, or metadata log, records metadata operations generated by data definition statements such as DROP TABLE
and ALTER TABLE
. MySQL uses this log to recover from crashes occurring in the middle of a metadata operation. When executing the statement DROP TABLE t1, t2
, we need to ensure that both t1
and t2
are dropped, and that each table drop is complete. Another example of this type of SQL statement is ALTER TABLE t3 DROP PARTITION p2
, where we must make certain that the partition is completely dropped and that its definition is removed from the list of partitions for table t3
.
A record of metadata operations such as those just described are written to the file ddl_log.log
, in the MySQL data directory. This is a binary file; it is not intended to be human-readable, and you should not attempt to modify its contents in any way.
ddl_log.log
is not created until it is actually needed for recording metadata statements, and is removed following a successful start of mysqld. Thus, it is possible for this file not to be present on a MySQL server that is functioning in a completely normal manner.
重点:
Currently, ddl_log.log
can hold up to 1048573 entries, equivalent 4 GB in size. Once this limit is exceeded, you must rename or remove the file before it is possible to execute any additional DDL statements. This is a known issue which we are working to resolve (Bug #83708).
There are no user-configurable server options or variables associated with this file.
本文出自 “影子骑士” 博客,请务必保留此出处http://andylhz2009.blog.51cto.com/728703/1948981
关于mysql的ddl_log.log文件