Hosting··4 min read

Import a Large SQL File in MAMP / MAMP PRO

MAMP bundles its own PHP and MySQL with their own limits. Here's how to import a big database without the phpMyAdmin upload error.

MAMP runs its own isolated PHP and MySQL stack. That's why editing your system php.ini does nothing — MAMP ignores it. You have to edit MAMP's copy, or go around phpMyAdmin entirely.

Edit the right php.ini

MAMP picks a php.ini based on the PHP version selected in its preferences. The file lives at:

/Applications/MAMP/bin/php/php{VERSION}/conf/php.ini

Match {VERSION} to the PHP version shown in MAMP → Preferences → PHP. Then raise:

upload_max_filesize = 512M
post_max_size = 512M
max_execution_time = 600
memory_limit = 1024M

Stop and restart the servers from the MAMP window. In MAMP PRO you can edit php.ini directly under File → Edit Template → PHP.

Import from the command line instead

MAMP's mysql client is the most reliable route for big files. The socket and binary live inside the MAMP folder:

/Applications/MAMP/Library/bin/mysql -u root -p \
  --socket=/Applications/MAMP/tmp/mysql/mysql.sock \
  your_database < ~/dump.sql

The default MAMP MySQL user is root with password root. The --socket flag matters — MAMP's MySQL listens on its own socket, not the system default, so plain `mysql` from Homebrew won't connect to it.

You're hitting the system MySQL socket instead of MAMP's. Always pass --socket=/Applications/MAMP/tmp/mysql/mysql.sock, or add --host=127.0.0.1 --port=8889 to use MAMP's TCP port.

Or split and import in chunks

Don't want to touch config files or the terminal? Split the dump below MAMP's upload cap and feed the chunks through phpMyAdmin one at a time.

Make a MAMP-friendly set of chunks

Split at statement boundaries so every piece imports cleanly through phpMyAdmin.

Open SQLSplit

Frequently Asked Questions

Why doesn't editing php.ini change MAMP's upload limit?

MAMP uses its own bundled PHP with a php.ini inside /Applications/MAMP/bin/php/php{VERSION}/conf/. Editing the macOS system php.ini has no effect. Edit MAMP's copy for the version selected in preferences, then restart the servers.

What is the default MAMP MySQL username and password?

Both username and password are 'root'. MySQL runs on port 8889 by default and uses the socket at /Applications/MAMP/tmp/mysql/mysql.sock.

How do I connect to MAMP MySQL from the terminal?

Use MAMP's own client at /Applications/MAMP/Library/bin/mysql and pass --socket=/Applications/MAMP/tmp/mysql/mysql.sock, or connect over TCP with --host=127.0.0.1 --port=8889.

Related articles

View all

Advertisement