简体   繁体   English

如何在OS X Lion中还原MySQL .frm .MYD .MYI文件

[英]How do I restore MySQL .frm .MYD .MYI files in OS X Lion

I received a bunch of these types of files and haven't a clue as how to restore the database on my Mac. 我收到了一堆这类文件,但对如何在Mac上还原数据库一无所知。 I've found instructions on how to do this on Windows, that you simply need to put these into a specific directory and the database should be restored, but I don't know which directory, or even where it would be located in OS X. 我已经找到了有关如何在Windows上执行此操作的说明,您只需要将它们放入特定目录中,然后就应该还原数据库,但是我不知道哪个目录,甚至它在OS X中的位置。 。

Any help would be greatly appreciated! 任何帮助将不胜感激!

To find you MySQL data directory, open the file /etc/my.cnf . 要找到您的MySQL数据目录,请打开文件/etc/my.cnf It should be there if you've MySQL installed. 如果您已安装MySQL,它应该在那里。

Find the variable datadir: datadir=/var/lib/mysql , create a directory under that and copy all your DB files in there, as in /var/lib/mysql/database , where database is your DB name. 找到变量datadir: datadir=/var/lib/mysql ,在该目录下创建一个目录,然后在其中复制所有数据库文件,如/var/lib/mysql/database ,其中database是您的数据库名称。

In a previous version of this answer I suggested to use sudo locate user.frm , but it didn't work, even after running sudo /usr/libexec/locate.updatedb . 在此答案的先前版本中,我建议使用sudo locate user.frm ,但即使运行sudo /usr/libexec/locate.updatedb后,它也无法正常工作。 If anyone knows why, I'd like to hear. 如果有人知道为什么,我想听听。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM