maxp
maxp

Reputation: 25141

Exporting and Restoring MySQL Schema in Windows/ Workbench

I am trying to restore a mysql database / schema, complete with data, to a new, empty database (on the same machine).

Going through the 'Manage Import / Export' menu option in 'workbench' lets me export and restore fine, except I cannot specify a new name for the new database / schema.

Can anyone point out anything Im missing?

The only workaround I can think of is to manually do a search and replace on the '.sql' file it created.

Thanks.

Upvotes: 3

Views: 3918

Answers (1)

bheussler
bheussler

Reputation: 1426

Have you considered using mysqldump to export your files from the command line and then mysqladmin to create a new database?

mysqldump -u username -p -v olddatabase > olddbdump.sql
mysqladmin -u username -p create newdatabase
mysql -u username -p newdatabase < olddbdump.sql

Upvotes: 6

Related Questions