Where apps hide your files
MAMP and MAMP PRO keep your sites and your MySQL databases in different places, and mixing them up is how people lose a project. Here is where each lives, how to confirm it in the app, and how to back up or move it safely.
For free MAMP:
/Applications/MAMP/htdocs/ web root (your sites)
/Applications/MAMP/db/ MySQL data, one folder per MySQL version inside
/Applications/MAMP/logs/ Apache, PHP and MySQL logs
/Applications/MAMP/conf/apache/ Apache configuration (httpd.conf)
MAMP's documentation gives /Applications/MAMP/htdocs/ as the default document root and /Applications/MAMP/db as the database folder. Inside db the folder is named after the MySQL version: recent releases let you choose MySQL 5.7 or 8.0 and keep mysql57 and mysql80 side by side, while very old releases used plain mysql. MAMP is not installed on the Mac used to check this guide, so run ls /Applications/MAMP/db to see which you have. PHP settings are not in conf/: each PHP version has its own php.ini under /Applications/MAMP/bin/php/.
For MAMP PRO, the MySQL data is outside the application folder, in a db folder with the same mysql57 and mysql80 names. MAMP PRO's own pages disagree on whether that is the system Library or your user Library, so check both:
/Library/Application Support/appsolute/MAMP PRO/db/
~/Library/Application Support/appsolute/MAMP PRO/db/
MAMP PRO's sites live wherever you set each site's folder. On first launch it copies htdocs to ~/Sites/localhost for the default "localhost" site, and its documentation recommends ~/Sites for new ones.
http://localhost:8888/. A button in the ports settings switches to 80 and 3306 if you prefer those.SHOW VARIABLES LIKE 'datadir'; in phpMyAdmin's SQL tab. The reply is the exact folder whichever version you run.Every database you create is a folder named after it, such as wordpress or shop. Beside them are MySQL's system schemas (mysql, performance_schema, sys), the InnoDB files (ibdata1, redo logs) and log files. Do not move individual table files such as .ibd: they only work together with ibdata1 and the rest of the data folder.
A common mistake is copying a single project folder from db/ to another Mac. It does not work on its own, because InnoDB keeps shared metadata in ibdata1. Use an export instead.
Backing up your site files is simple, since htdocs is ordinary files you can copy or put in Git. Databases need an export:
.sql file.You can also use the mysqldump that MAMP bundles. In MAMP 7 it sits in a folder per MySQL version, such as /Applications/MAMP/Library/bin/mysql80/bin/; MAMP 6 and earlier kept it directly in /Applications/MAMP/Library/bin/. For MAMP 7 with MySQL 8.0:
/Applications/MAMP/Library/bin/mysql80/bin/mysqldump -u root -p --host=127.0.0.1 --port=8889 shop > shop.sql
Replace shop with your database name, and mysql80 with mysql57 if that is the server you run. MAMP's default MySQL login is user root with password root, which is worth changing if the Mac is on a shared network. A copy of the whole /Applications/MAMP folder, taken with MAMP quit and the servers stopped, is also a valid backup of everything in it.
To serve a different folder, change the Document root (above) and restart the servers. MAMP's documentation suggests exactly this, for example pointing it at ~/Sites/my-project, and notes that changing the setting does not move or delete any files.
Keeping projects outside /Applications/MAMP matters because MAMP's uninstall instructions are simply to delete that folder, which removes htdocs and the free version's databases with it. Upgrading is gentler: the installer keeps htdocs, copies your databases into the new install and renames the old folder to a dated backup. Export your databases before an upgrade anyway.
MAMP PRO's uninstaller removes its db folder, and its documentation warns you to back databases up first. MAMP PRO also cannot keep database files in a location you choose. When it moves you to a newer MySQL version it copies the databases and keeps the old folder (such as mysql56, or mysql57 after a move to 8.0), so you may see more than one mysql* folder. Delete an old one only after your sites run on the new version.
If WordPress or another site cannot write uploads, check the folder's permissions and which account Apache runs as. MAMP's documentation does not state that user for free MAMP. Configurations people have published show httpd.conf setting it to the logged-in user, but check yours while the servers run:
ps -axo user,comm | grep -i mamp
The first column is the account each MAMP process runs as. MAMP PRO 6 had a Run server as setting offering either your own account or the www and mysql users.
| MAMP | MAMP PRO | |
|---|---|---|
| Web root | /Applications/MAMP/htdocs | Per site, set in the app |
| MySQL data | Inside /Applications/MAMP/db | appsolute/MAMP PRO/db under Application Support |
| Sites | One document root | Many sites, each with its own folder |
MAMP's documentation says the two share the same Apache and MySQL programs, and running both at once causes port conflicts and configuration overwrites and can lose data. Quit one before starting the other.
When you are not sure whether a database lives in the free app's folder or one of MAMP PRO's Library folders, type ibdata1 into Everywhere: every MySQL data folder on the Mac appears in one list, including any under ~/Library, where Spotlight does not look. Typing httpd.conf lists each Apache configuration copy. It searches names only, so open phpMyAdmin when you need to know what a database holds.
In free MAMP it is /Applications/MAMP/htdocs, unless you changed the Document root in MAMP's Server settings. In MAMP PRO each site has its own Site folder, often under ~/Sites.
Free MAMP keeps them under /Applications/MAMP/db/, in a folder named for the MySQL version such as mysql57 or mysql80. MAMP PRO uses a db folder under appsolute/MAMP PRO in Application Support.
Export it from phpMyAdmin (Export tab) or run MAMP's bundled mysqldump. Copying a single database folder does not give a usable backup.
Yes. In MAMP 7 set a new Document root under MAMP > Settings > Server, then restart the servers. Keeping sites outside /Applications/MAMP means they survive if that folder is deleted.
Everywhere keeps track of every file on your Mac — including the folders Spotlight hides and drives you have unplugged. Free for a day, then $19 once.
Version 2.20.3 · macOS 13+ · 4.7 MB · notarised