如何在 OS X Lion 中恢复 MySQL .frm .MYD .MYI 文件
我收到了一堆此类文件,但不知道如何在 Mac 上恢复数据库。我找到了有关如何在 Windows 上执行此操作的说明,您只需将它们放入特定的目录中,并且应该恢复数据库,但我不知道哪个目录,甚至不知道它在 OS X 中的位置 !
任何帮助将不胜感激
I received a bunch of these types of files and haven't a clue as how to restore the database on my 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.
Any help would be greatly appreciated!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
要找到 MySQL 数据目录,请打开文件
/etc/my.cnf
。如果您安装了 MySQL,它应该在那里。找到变量datadir:
datadir=/var/lib/mysql
,在该目录下创建一个目录并将所有数据库文件复制到其中,如/var/lib/mysql/database
code>,其中database
是您的数据库名称。在此答案的先前版本中,我建议使用 sudo located user.frm ,但即使在运行 sudo /usr/libexec/locate.updatedb 后它也不起作用。如果有人知道为什么,我想听听。
To find you MySQL data directory, open the file
/etc/my.cnf
. It should be there if you've MySQL installed.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
, wheredatabase
is your DB name.In a previous version of this answer I suggested to use
sudo locate user.frm
, but it didn't work, even after runningsudo /usr/libexec/locate.updatedb
. If anyone knows why, I'd like to hear.