user1125177
user1125177

Reputation: 345

MySQL Restoring data from .dat file

I deleted my database and customer service sent me back a .dat file but their instructions what to do with it were bad.

They said to put the (db_backup.dat) file in mysql/data folder and then do an export to sql to restore data. Can anyone help out here how to do this the file is not a text file with sql commands in it just lots of things that are not readable.

Upvotes: 1

Views: 4269

Answers (2)

Ajax
Ajax

Reputation: 63

Looks like they could've sent you bare data file, which you should put into mysql folder and restart mysql server.

In case they sent you bare DB file, you should ask customer service which format is that. It could be a MyISAM or InnoDB file. In case they tell you format you should crate a new database of that format titled db_backup, then find where you mySQL instance keep files, stop server, put the file you get from CS into that folder, replacing existing one and start server again.

Finally, can you post few first lines of the file or screenshot from Notepad++ ?

P.S. All above are guesses until you post head of the file or which format it is.

Upvotes: 2

Ben Poulson
Ben Poulson

Reputation: 3505

I'm assuming the .dat file is a text file.

mysql -u root -p password < db_backup.dat

Upvotes: 2

Related Questions