macos Mac OS X mySQL 自定义数据库路径 (MAMP PRO)
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4745822/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Mac OS X mySQL custom database path (MAMP PRO)
提问by mikkelbreum
I'm using MAMP (OS-X 10.6.6) and I want to move my mySQL db folder to my dropbox folder. The MySQL server MAMP runs stores its databases in
我正在使用 MAMP (OS-X 10.6.6) 并且我想将我的 mySQL db 文件夹移动到我的 dropbox 文件夹中。MySQL 服务器 MAMP 运行将其数据库存储在
/Library/Application Support/appsolute/MAMP PRO/db/mysql
..and I can't get it to follow symlinks or aliases to the mysql folder.
..而且我无法让它跟随符号链接或别名到 mysql 文件夹。
Is there a way to change the path mySQL uses for storing its databases? On the MAMP forum they say it's not possible, but I imagine there must be some kind of config file for whatever mySQL server it is that MAMP is running that can be changed to specify an alternative location for the used DBs..?
有没有办法更改 mySQL 用于存储其数据库的路径?在 MAMP 论坛上,他们说这是不可能的,但我想对于 MAMP 正在运行的任何 mySQL 服务器,必须有某种配置文件,可以更改为使用的数据库指定替代位置..?
Anyone know how to acheive this? Storing the DB's on dropbox is the last element I need to solve to be able to work on my projects from my different computers.
有谁知道如何实现这一目标?将 DB 存储在 Dropbox 上是我需要解决的最后一个要素,以便能够在不同的计算机上处理我的项目。
回答by mikkelbreum
Just realized that its just the finder 'alias' type that won't work. creating a proper unix symlink works fine. so doing this solves the problem and keeps the databases on dropbox.
刚刚意识到它只是 finder 'alias' 类型不起作用。创建一个适当的 unix 符号链接工作正常。这样做可以解决问题并将数据库保存在 dropbox 上。
ln -s /Users/username/Dropbox/MAMP_db/mysql /Library/Application\ Support/appsolute/MAMP\ PRO/db/mysql
回答by Lane
mwb's method works. Remember, you also need to be be running Apache/MySQL server as user. Those settings are in MAMP PRO (Server -> General)
mwb 的方法有效。请记住,您还需要以用户身份运行 Apache/MySQL 服务器。这些设置在 MAMP PRO (Server -> General)
If you are going to be using dropbox to access the database on another machine, you will need to have identical paths to Dropbox as well.
如果您打算使用 dropbox 访问另一台计算机上的数据库,则您还需要具有与 Dropbox 相同的路径。