How come when I write the following line in my CMD:
mysqldump -hHOST -uAdmin -p TestDatabase --single-transaction --routines --triggers > "C:\testdump_backup\testdump.sql"
Then the file has this in it
CREATE DATABASE /*!32312 IF NOT EXISTS*/ `TestDatabase ` /*!40100 DEFAULT CHARACTER SET latin1 */;
USE `TestDatabase`;
This is a problem for me, when I want to load all this to another database called Database_production
like this:
mysql -hHOST -uAdmin -p Database_production < "C:\testdump_backup\testdump.sql"
It all works if I just use the following mysqldump line:
mysqldump -hHOST -uAdmin -p TestDatabase > "C:\testdump_backup\testdump.sql"
The only problem is that this doesn't contain my stored_procedures and function
, which I need.
With the above line the file doesn't have that part with USE TestDatabase;
, but which of the --..
adds this part?
I need to mysqldump to copy tables/stored_procedures/functions
, thats why I used --single-transaction --routines --triggers
, but what am I missing here, do I even need the --...
or?