Bug #3517 Foreign key checks and no binlog option for mysqldump
Submitted: 20 Apr 2004 17:44 Modified: 21 Aug 2009 9:54
Reporter: Melvyn Sopacua Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: mysqldump Command-line Client Severity:S4 (Feature request)
Version: OS:Any (Any)
Assigned to: CPU Architecture:Any

[20 Apr 2004 17:44] Melvyn Sopacua
Description:
Please add a --disable-foreign-keys and --disable-binlog option, which sets FOREIGN_KEYS_CHECK and SQL_LOG_BIN to 0 respectively.
I'm kinda getting tired of:
echo 'SET SQL_LOG_BIN=0; SET FOREIGN_KEYS_CHECK=0;' > out.sql && \
mysqldump ... >> out.sql

-:)

The foreign keys is more important than the binlog option, since restoring or copying InnoDB databases is not working correctly otherwise.
The binlog option, is more for 'development' situations, where you have to migrate tables or something similar, and you know you're gonna need a few tries.
Makes no sence to clutter the binlog, each time you restore the database/table to it's original state.
Also - in some situations, it's faster or necessary (in case of broken round-robin replication) to restore on both master and slave, then letting this go through the replication process.

How to repeat:
not applicable

Suggested fix:
Add --disable-foreign-keys and --disable-binlog and corresponding functionality.
[21 Aug 2009 9:54] Susanne Ebrecht
This is already implemented in newer MySQL versions (5.0, 5.1) in mysqldump.