Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

We had some problems with our MySQL server and somehow all I've got is a database.mysql file for the database I want to restore.

I've done a bit of googleing but I didn't find anything about how should I handle this type of file.

It's worth mentioning that the server was running Plesk and the database wasn't using InnoDB.

Edit: I've forgot to mention that I don't know what application created the .mysql file and that it's in binary format.

Thanks,

share|improve this question
1  
what is the output of file database.mysql? Perhaps it is just a compressed dump? –  Zoredache Jan 4 '11 at 18:03
    
Turns out it was a compressed dump and I was able to decompress it and restore my tables. If you'll update your answer I'll mark this as closed. –  Brayn Jan 4 '11 at 22:06

1 Answer 1

up vote 0 down vote accepted

How was the database.mysql created? If it was just a standard mysqldump then all you should have to do is something like cat database.mysql | mysql -h hostname -u username -p [database].

You can tell it is a mysql dump file by looking at the file in a text editor. The first few lines of a mysqldump will look like this.

-- MySQL dump 10.11
--
-- Host: web-06.example.org    Database: mysql
-- ------------------------------------------------------
-- Server version   5.0.51a-24+lenny4

If it is a dump you may need to examine the dump file a bit. It may not perform the required create database statement, and you may need to do that. You will probably also need to recreate any accounts if the dump you have didn't include the database named mysql which includes the accounts and privileges.

share|improve this answer
    
I forgot to mention that it's a binary file. Thanks. –  Brayn Jan 4 '11 at 18:00

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.