Bug #16334 mysqldump --opt should include --routines and --triggers
Submitted: 10 Jan 2006 11:35 Modified: 17 Jan 2006 13:04
Reporter: Anders Henke Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server Severity:S4 (Feature request)
Version:5.0.18 OS:Linux (Linux)
Assigned to: CPU Architecture:Any

[10 Jan 2006 11:35] Anders Henke
Description:
--opt usually includes all options required to get a dump which can be replayed on an empty server in order to recreate the database "as is". With MySQL 5.0, stored procedures  and Triggers are not included in a --opt-dump.

How to repeat:
Run 'mysqldump --opt' on a database with routines and verify that "--routines" and
--triggers is not automatically enabled :-)

Suggested fix:
I think that with MySQL 5.0, Triggers, Stored Procedures and so on should also be included in such a dump and enable --routines and --triggers if --opt has been set.
[17 Jan 2006 13:04] Sergei Golubchik
--opt actually means to create an "optimized" dump with all MySQL extensions that make a load faster.

--triggers is enabled by default, so even with --opt it is enabled.

--routines is not enabled by default, because it creates a dump that is not identical to the original database. See the manual for explanation, but a short version is - if you're a root and want to dump everything exactly as it is and restore as an identical copy, don't use --routines, but dump mysql.* tables directly. If you have no access to them - use --routines, but some metadata will be lost (definer and time of the creation).