19

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?

Brian Weinreich
  • 7,692
  • 8
  • 35
  • 59

7 Answers7

44

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.

Community
  • 1
  • 1
  • 1
    This was the version that helped me as well. I think this is the correct answer for the newest version of MAMP Pro as of this writing. – Hendeca Jun 27 '14 at 23:20
20

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!

Brian Weinreich
  • 7,692
  • 8
  • 35
  • 59
  • That's not guaranteed to be where there are. InnoDB is now the default storage engine for MAMP. These links may help those who are looking: http://documentation.mamp.info/en/mamp/how-tos/check-the-default-storage-engine-of-mysql http://documentation.mamp.info/en/mamp-pro/how-tos/set-the-mysql-default-storage-engine http://dev.mysql.com/doc/refman/5.0/en/storage-engines.html – Alex Zavatone Feb 28 '14 at 17:51
  • 9
    If you are on good old MAMP, they will be located at /Applications/MAMP/db/ and if you are on MAMP Pro, they are located at /Library/Application Support/appsolute/MAMP PRO/db/mysql/ – Alex Zavatone Feb 28 '14 at 20:25
3

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

vrwired
  • 116
  • 1
  • 5
1

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.

ioCron
  • 873
  • 8
  • 9
1

For MAMP PRO 4.2.0 on a Windows 10 machine this info can be found as follows:

  1. open in a text editor the mysql ini file

    C:\Users\Public\Documents\Appsolute\MAMPPRO\conf\my.ini
    
  2. look for the 'datadir' entry

In my case it is:

datadir = C:/Users/Public/Documents/Appsolute/MAMPPRO/db/
Suraj Rao
  • 29,388
  • 11
  • 94
  • 103
micmor
  • 491
  • 3
  • 3
0

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 user after entering your pass in the prompt you will get a long list of variables search for datadir that's where your databases are stored

kapreski
  • 761
  • 5
  • 19
0

MAMP store its databases into this folder:

/Applications/MAMP/db/mysql
Yvan Rugwe
  • 618
  • 7
  • 13