开发者

Is it OK to move an old MySQL data folder to a new MySQL install's folder?

I've installed MySQL on my Mac running lion using their DMG installer. This has created 2 folders, mysql-5.5.15-osx10.6-x86_64 and mysql-5.5.9-osx10.6-x86_64 with a symlink from /usr/local/mysql/ lead开发者_开发百科ing to the newer one. My databases are still in the old folder, in the data folder.

Is it OK to just delete the new data folder, then move the old data folder into the newly installed folder (/usr/local/mysql-5.5.15-osx10.6-x86_64) using this:

sudo mv /usr/local/mysql-5.5.9-osx10.6-x86_64/data /usr/local/mysql-5.5.15-osx10.6-x86_64/data

Are there any gotchas I need to worry about? Is it smarter to just change this in the configuration file?


You should look at your my.cnf file to see which folder it is pointing to as the datadir. If you delete the folder it's pointing to, it won't know where to find your data. You can change this value to point to where ever you want your data stored.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜