mysql - mysqldump inserts "drop database" statement in the middle of the dump -
i dumping databases system using mysqldump. problem is: sql file contains "delete database" in middle of file, unfortunately import of files fails - quite logically in eyes.
the mysqldump command line follows:
mysqldump -u$user -p$pass \ --default-character-set=utf8 --single-transaction \ --add-drop-database --add-drop-table \ --databases $db
when try re-import sql file, error: error 1146 (42s02) @ line 3486: table 'meta.tx_baauftragsdb_auft' doesn't exist
.
looking @ sql dump file see these lines:
3470 -- 3471 -- current database: `meta` 3472 -- 3473 3474 /*!40000 drop database if exists `meta`*/; 3475 3476 create database /*!32312 if not exists*/ `meta` /*!40100 default character set utf8 */; 3477 3478 use `meta`; 3479 3480 -- 3481 -- view structure view `tx_baauftragsdb_view_ueber` 3482 -- 3483 3484 /*!50001 drop table if exists `tx_baauftragsdb_view_ueber`*/; 3485 /*!50001 drop view if exists `tx_baauftragsdb_view_ueber`*/; 3486 /*!50001 create algorithm=undefined definer=`meta`@`localhost` sql security
... , there drop databse statement. if delete below statement db imports fine, ... ... i'd know what's happening here.
can tell me what's going on here, why there drop database
statement, , maybe i'm doing wrong?
it's bug in old versions of mysql: http://bugs.mysql.com/bug.php?id=17201
upgrading recommended :)
Comments
Post a Comment