shriguru nayak
shriguru nayak

Reputation: 310

Loading the databases from previous installation

My Windows OS crashed today. Now I have recovered all the files in Program files/MySQL folder.(I don't have the exported .sql file)

With the new installation of MySQL 5.6(same as before), can I get those databases back(Or how to load the data to new installation of MySQL)? Please suggest.

Upvotes: 3

Views: 257

Answers (3)

Jonathan Amend
Jonathan Amend

Reputation: 12815

The location of your data files for MySQL on Windows is unfortunately dependent on a few parameters (MySQL version, Windows version, installation directory). The cleanest approach is to find your my.cnf file, which is usually located at C:\Program Files\MySQL\MySQL Server [version]\my.ini, but might also be at C:\Windows\my.ini if you used a custom installation directory. In this file, look for the datadir setting to find your data files. You can follow the same procedure for your new installation to figure out where to copy those files to.

References:

MySQL Installation Layout on Microsoft Windows

Troubleshooting a Microsoft Windows MySQL Server Installation

Upvotes: 4

Raydel Miranda
Raydel Miranda

Reputation: 14360

According to this: Copying MySQL Databases to Another Machine.

You can copy the .frm, .MYI, and .MYD files for MyISAM tables between different architectures that support the same floating-point format.

In cases where you need to transfer databases between different architectures, you can use mysqldump to create a file containing SQL statements. You can then transfer the file to the other machine and feed it as input to the mysql client.

You already copied the data so, I suspect you have installed a Windows with a different architecture to the previous one.

Some ideas:

  • Check if your new windows is the same version the previous one.
  • Install a virtual machine with the previous one windows version and then use mysqldump.

And the most extreme:

  • Reinstall you system with the previous version.

Upvotes: 3

Hauke P.
Hauke P.

Reputation: 2833

Try copying the contents of your recovered data folder into a new folder here:

C:\Users\<your username>\AppData\Local\VirtualStore\Program Files\MySQL\data

Then try starting the MySQL demon and check if you can access your data again.

Upvotes: 3

Related Questions