I'm using this command syntax :
mysqldump -u<username> -p<password> --no-create-db --databases mydatabase > /var/backups_DB/MyDatabase-$(date +"%d-%m-%Y-%H:%M:%S").sql
But I could not find how to prevent the line "use mydatabase" to be inserted in the generated file. Which option should I use?
$ mysqldump -u [uname] -p[pass] db_name > db_backup.sql
– NickelsUSE 'mydatabase';
is inserted too and I would like to avoid it. I managed to remove theCREATE DATABASE
statement using--no-create-db
option, but can't get the other statement out. – Planking--databases
option. – Vendetta