Ronedog
Ronedog

Reputation: 2331

mysql - how do I load data from a different configuration

I'm not sure if this will make sense, but I'll give it a shot.

My hard drive went down and I had to reinstall the os along with all my webserver configuration,etc. I kept a backup of the mysql database, but it doesn't contain all the tables...I added a couple tables after my last backup.

I have access to the hard drive and the directory where the mysql data files are stored from the failed hard drive, but I don't know how to retrieve the data into my new mysql database. Is it even possible to get the raw data files from mysql and load them into a different instance? I'd even be happy if there was some way for phpmyadmin to show the data files, then I could dump out to a backup txt file, and reload them into my new configuration.

Any help will be appreciated. thanks.


well, bad news...I can't access the drive anymore. As I tried to copy the files the drive went totally down. So, I'll just redo the couple tables. Thanks for your help anyway.

Upvotes: 1

Views: 268

Answers (2)

Tomislav Nakic-Alfirevic
Tomislav Nakic-Alfirevic

Reputation: 10173

Although not recommended or reliable, it is possible to simply copy the data without using mysqldump. It might help if MySQL was shut down in a controlled manner (which does not appear to be the case) and the source and target environments are as similar as possible in terms of lib and MySQL versions.

Upvotes: 1

Adam Morris
Adam Morris

Reputation: 8545

The datafiles should be compatible - you can copy the data directory to ubuntu, and edit the /etc/mysql/my.cnf to point to the new directory.

The only catch might be where ubuntu being case sensitive effects the tables.

Upvotes: 1

Related Questions