Bug #77769 | mysqldump includes ALTER DATABASE statement even if --no-create-db option used | ||
---|---|---|---|
Submitted: | 17 Jul 2015 16:32 | Modified: | 22 Jul 2015 13:28 |
Reporter: | kip robinson | Email Updates: | |
Status: | Verified | Impact on me: | |
Category: | MySQL Server: mysqldump Command-line Client | Severity: | S3 (Non-critical) |
Version: | 5.5/5.6/5.7 | OS: | Any |
Assigned to: | CPU Architecture: | Any |
[17 Jul 2015 16:32]
kip robinson
[22 Jul 2015 13:04]
MySQL Verification Team
Dump file
Attachment: utf8test_dump.sql (text/x-sql), 4.27 KiB.
[22 Jul 2015 13:28]
MySQL Verification Team
Thank you for the bug report and test case.
[30 Nov 2020 23:11]
Mark B
It's been over 5 years. Any update on this? I just ran into this issue today.
[17 Nov 2021 15:00]
Sil M
I found a workaround that worked for me: Make sure your database collation and charset are the same as the database defaults and/or server defaults. Also, mysqldump keeps generating ALTER DATABASE statements if you have procedures, functions or triggers that were created while the database had a different collation. That can be fixed by recreating them. To identify the procedures you can either check your mysqldump sql output file or query the information_schema views: SELECT ROUTINE_SCHEMA, ROUTINE_NAME, DATABASE_COLLATION FROM information_schema.ROUTINES WHERE ROUTINE_SCHEMA NOT IN ('mysql', 'sys'); SELECT TRIGGER_SCHEMA, TRIGGER_NAME, DATABASE_COLLATION FROM information_schema.TRIGGERS WHERE TRIGGER_SCHEMA NOT IN ('mysql', 'sys');