Mysqldump question

mysql

Solution

Maybe you used something like this:

`mysqldump -u -p <other options> --database your_database > file.sql`

I discovered that when you use `--database`, the script is generated with that 'use your_database' line. So, don't use that option and the line is gone:

mysql -u -p <other options> your_database > file.sql

Problem

I am trying to dump a large database using mysqldump command. I would like to avoid 'use database' command in the generated sql file. This is because I want to create the same database with a different name. Since the sql file size is large I am unable to open the sql file and edit it. I tried --no-create-db but still I am getting use command in the dump file Please help.

Original source