mysql restore to different database

@minaz answer was good, but I want to append a little bit more.

The problem was caused by --databases keyword. If you omit the keyword, it will not contain any database creation contents.

So, Dump without --databases keyword.

mysqldump -u username -p database_name > dump.sql

And restore it with the target database name.

mysql -u username -p target_database_name < dump.sql

Also, there are several ways to do this. See the similar problem on here (dba.stackexchange).

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)