Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I restore a dump file from mysqldump?

I was given a MySQL database file that I need to restore as a database on my Windows Server 2008 machine.

I tried using MySQL Administrator, but I got the following error:

The selected file was generated by mysqldump and cannot be restored by this application.

How do I get this working?

like image 919
Zack Peterson Avatar asked Sep 19 '08 21:09

Zack Peterson


People also ask

How do I restore a .frm file in MySQL?

1- create some dummy tables with at least one column and SAME NAME with frm files in a new mysql database. 3- copy and paste the old frm files to newly created table's frm files, it should ask you if you want to overwrite or not for each. replace all. 4-start mysql service, and you have your table structure...


1 Answers

If the database you want to restore doesn't already exist, you need to create it first.

On the command-line, if you're in the same directory that contains the dumped file, use these commands (with appropriate substitutions):

C:\> mysql -u root -p  mysql> create database mydb; mysql> use mydb; mysql> source db_backup.dump; 
like image 196
Dónal Avatar answered Nov 08 '22 19:11

Dónal