Skip to content

Instantly share code, notes, and snippets.

@aaronsummers
Last active January 22, 2020 11:02
Show Gist options
  • Save aaronsummers/60631fff3cf3f0e5d865948d2d635317 to your computer and use it in GitHub Desktop.
Save aaronsummers/60631fff3cf3f0e5d865948d2d635317 to your computer and use it in GitHub Desktop.
Import Database into MAMP PRO using terminal

source: https://timmyomahony.com/blog/MAMP-phpmyadmin-and-big-database-imports-errors-or-timeouts/

IMPORT DATABASE INTO MAMP

  1. Create the database and database user phpMyAdmin as usual.

  2. Connect to mysql by running the following command from the directory where the dump file was stored:

    /Applications/MAMP/Library/bin/mysql --host=localhost -uroot -proot

  3. Run the following from the mysql commandline: (replace “mydatabase” with the name of the database you created in step 1 or that was already in your dump and replace “myfile.sql” with the name of your file):

    mysql> use mydatabase;

    mysql> source myfile.sql;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment