Sequel Pro / MAMP 在哪里存储本地数据库?
我通过 Sequel Pro 和 Sequel Pro 在我的计算机上创建了一些数据库。 MAMP,并运行 localhost 来查看它们。但是,我全新安装了 Mac OS Lion,但忘记将数据库备份到 .sql 文件。
我会定期备份文件,并预装计算机的副本。有谁知道db文件的路径吗?它们是否以我可以重建的格式存储,以便我可以导入到 Sequel Pro 中?
I had a few databases created on my computer via Sequel Pro & MAMP, and was running localhost to view them. However, I did a fresh install of Mac OS Lion, and I forgot to backup the databases to .sql files.
I do backup my files regularly, and have a copy of the computer pre-install. Does anyone know the path to the db files? Are they stored in a format that I could rebuild, so I could import into Sequel Pro?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(7)
Brian W 的回答并没有真正帮助我使用 MAMP Pro (v2.1.4),但幸运的是其他人帮了我。我的位置是:
/Library/Application Support/appsolute/MAMP PRO/db/mysql
他们还说他们已将其移动到 Dropbox,然后使用 unix 符号链接作为原始位置(不是 Mac OS X 别名,因为他们不这样做)不起作用),这样它也会得到备份。
Brian W's answer didn't really help with me using MAMP Pro (v2.1.4), but luckily someone else did. Location for mine were:
/Library/Application Support/appsolute/MAMP PRO/db/mysql
They also said that they've moved it to Dropbox and then used a unix symlink for the original location (not a Mac OS X alias as they don't work), that way it does get backed up as well.
好吧,我明白了。如果您使用 MAMP 和 localhost 创建数据库,则只需转到 MAMP >分贝> mysql 文件夹,其中将包含您的所有数据库。
希望对使用 Sequel Pro / MAMP / Localhost 的人有所帮助!
Okay, I figured it out. If you are using MAMP and localhost to create databases, you just need to go to MAMP > db > mysql folder and in there will be all your databases.
Hope that helps anyone who uses Sequel Pro / MAMP / Localhost!
要将以前的数据库从标准 MAMP 转移到 MAMP PRO:
复制
/应用程序/MAMP/db/mysql/
进入
/Library/Application Support/appsolute/MAMP PRO/db/mysql/
要继承以前的数据库用户,您需要复制:
/应用程序/MAMP/db/mysql/mysql/
进入
/库/应用程序支持/appsolute/MAMP PRO/db/mysql/mysql
To carry over previous databases from Standard MAMP to MAMP PRO:
copy over
/Applications/MAMP/db/mysql/
into
/Library/Application Support/appsolute/MAMP PRO/db/mysql/
To carry over previous database users you need to copy over:
/Applications/MAMP/db/mysql/mysql/
into
/Library/Application Support/appsolute/MAMP PRO/db/mysql/mysql
您还可以在 Sequel Pro 文档(MAMP、MAMP PRO、XAMPP、Zend 等)中找到有关 MAMP 目录(包括数据库文件、错误日志等)的更多信息:
https://sequelpro.com/docs/ref/mysql/mysql-files
这让我安静了很多。
You can also find more informations about the MAMP Directories (including the db files, error logs, etc.) in the Sequel Pro Docs (MAMP, MAMP PRO, XAMPP, Zend, etc.):
https://sequelpro.com/docs/ref/mysql/mysql-files
That helped me quiet a lot.
对于 Windows 10 计算机上的 MAMP PRO 4.2.0,可以按如下方式找到此信息:
在文本编辑器中打开 mysql ini 文件
查找“datadir”条目
在我的例子中是:
For MAMP PRO 4.2.0 on a Windows 10 machine this info can be found as follows:
open in a text editor the mysql ini file
look for the 'datadir' entry
In my case it is:
您可以通过运行此命令动态获取数据的路径
mysqladmin -h host -u root -p变量
当然您必须将主机更改为您的主机(最有可能是)
localhost
root 为您的用户名或
root
(如果您将其用作默认用户)在提示中输入密码后,您将获得一长串变量
搜索
datadir
这是您的数据库的存储位置you can get the path to your data dynamically by running this command
mysqladmin -h host -u root -p variables
of course you have to change host to your host (most likely to be)
localhost
and root to your username or
root
in case your using it as the default userafter entering your pass in the prompt you will get a long list of variables
search for
datadir
that's where your databases are storedMAMP 将其数据库存储到此文件夹中:
MAMP store its databases into this folder: