重装MYSQL(windows)——怎么去旧的数据与新安装吗?Re-installing MYSQL(windows) - How to get to the old data with the new install?

- 此内容更新于:2014-12-30
主题:

我需要重新安装我的电脑但是我没有考虑出口数据从mysql 5。 我怎么得到数据从旧的安装到新安装,这只是复制数据目录或我必须采取其他步骤去数据吗?

原文:

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?

解决方案:
原文:

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!

Mischa Kroon的回复:my.cnf & lt;——这是什么,我在哪里可以找到它?

(原文:my.cnf <--- what is this and where can I find it ?)

bobince的回复:MySQL配置文件。根据MySQL建立你# 39;重新使用它可能会在Windows文件夹(哇!),或者在程序文件 my.ini MySQL。

(原文:The MySQL config file. Depending on what MySQL build you're using it might be in the Windows folder (yuck!), or in Program FilesMySQL as my.ini.)

解决方案:
我将从mysql数据导出为一个sql文件(即:phpmyadmin),然后将其导入新安装。你的数据库应该构建和数据很容易。 你说你“不考虑出口数据”。这是否意味着你没有访问旧的安装了吗?
原文:

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?

Mischa Kroon的回复:这是否意味着你不要# 39;t访问旧的安装了吗?我只有访问文件不再mysql安装。

(原文: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.)