MySQL Sequel Pro / MAMP 在哪里存储本地数据库?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/7341897/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-31 21:01:42  来源:igfitidea点击:

Where does Sequel Pro / MAMP store local databases?

mysqlsqldatabasemacosmamp

提问by Brian Weinreich

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.

我通过 Sequel Pro & MAMP 在我的计算机上创建了一些数据库,并且正在运行 localhost 来查看它们。但是,我重新安装了 Mac OS Lion,但忘记将数据库备份到 .sql 文件。

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?

我会定期备份我的文件,并预安装了计算机的副本。有谁知道db文件的路径?它们是否以我可以重建的格式存储,以便我可以导入 Sequel Pro?

回答by Brendan Underwood

Brian W's answerdidn't really help with me using MAMP Pro (v2.1.4), but luckily someone else did. Location for mine were:

Brian W 的回答对我使用 MAMP Pro (v2.1.4) 并没有真正帮助,但幸运的是其他人做到了。我的位置是:

/Library/Application Support/appsolute/MAMP PRO/db/mysql

/库/应用程序支持/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.

他们还说他们已将其移至 Dropbox,然后使用 unix 符号链接作为原始位置(不是 Mac OS X 别名,因为它们不起作用),这样它也确实得到了备份。

回答by Brian Weinreich

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.

好吧,我想通了。如果您使用 MAMP 和 localhost 来创建数据库,您只需要转到 MAMP > db > mysql 文件夹,那里将有您的所有数据库。

Hope that helps anyone who uses Sequel Pro / MAMP / Localhost!

希望对任何使用 Sequel Pro / MAMP / Localhost 的人有所帮助!

回答by vrwired

To carry over previous databasesfrom Standard MAMP to MAMP PRO:

要将以前的数据库从标准 MAMP 转移到 MAMP PRO:

copy over /Applications/MAMP/db/mysql/ into /Library/Application Support/appsolute/MAMP PRO/db/mysql/

将 /Applications/MAMP/db/mysql/ 复制到 /Library/Application Support/appsolute/MAMP PRO/db/mysql/

To carry over previous database usersyou need to copy over: /Applications/MAMP/db/mysql/mysql/ into
/Library/Application Support/appsolute/MAMP PRO/db/mysql/mysql

要继承以前的数据库用户,您需要将:/Applications/MAMP/db/mysql/mysql/ 复制到
/Library/Application Support/appsolute/MAMP PRO/db/mysql/mysql

回答by ioCron

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

您还可以在 Sequel Pro Docs(MAMP、MAMP PRO、XAMPP、Zend 等)中找到有关 MAMP 目录(包括 db 文件、错误日志等)的更多信息:https:
//sequelpro.com/docs /ref/mysql/mysql-files

That helped me quiet a lot.

这让我安静了很多。

回答by kapreski

you can get the path to your data dynamically by running this command

您可以通过运行此命令动态获取数据的路径

mysqladmin -h host -u root -p variables

mysqladmin -h host -u root -p variables

of course you have to change host to your host (most likely to be) localhostand root to your username or rootin case your using it as the default user after entering your pass in the prompt you will get a long list of variables search for datadirthat's where your databases are stored

当然,您必须将主机更改为您的主机(最有可能是)localhost并将根更改为您的用户名,或者root如果您在提示中输入您的通行证后将其用作默认用户,您将获得一长串变量搜索datadir那是哪里您的数据库已存储

回答by Yvan Rugwe

MAMP store its databases into this folder:

MAMP 将其数据库存储到此文件夹中:

/Applications/MAMP/db/mysql

/应用程序/MAMP/db/mysql