tags:

views:

95

answers:

2

I needed to re-install my computer but I didn't think about exporting the data from mysql 5.

How do I get the data from the old installation into the new installation, is this just copying the data directory or do I have to take other steps to get to the data?

A: 

I would export your data as a sql file from mysql (ie: with phpmyadmin) and then import it into the new installation. Your db should be built and filled with data pretty easily.

You said that you "didn't think about exporting the data". Does that mean you don't have access to the old installation any more?

kevtrout
Does that mean you don't have access to the old installation any more?I only have access to the files not the mysql install anymore.
Mischa Kroon
+1  A: 

For MyISAM tables you can generally get away with copying them across. (Whilst the server's stopped, obviously.) For InnoDB, it can work, but you'll have to have the same basic block size settings. If you can use the same major version of MySQL and the same my.cnf you stand a good chance of having it work.

Afterwards it's a good idea to ensure the tables are rebuilt (eg. using ALTER TABLE), and make a note to mysqldump properly next time because none of this is supported or guaranteed to work!

bobince
my.cnf <--- what is this and where can I find it ?
Mischa Kroon
The MySQL config file. Depending on what MySQL build you're using it might be in the Windows folder (yuck!), or in Program Files\MySQL as my.ini.
bobince