Skip to content

Instantly share code, notes, and snippets.

@MrCoker
Forked from aaronsummers/howto.md
Last active March 3, 2022 20:11
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save MrCoker/5fa6d4c2bbb4e99fcd235a139da491fe to your computer and use it in GitHub Desktop.
Save MrCoker/5fa6d4c2bbb4e99fcd235a139da491fe to your computer and use it in GitHub Desktop.
Import Database into MAMP 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 path/name of your file making sure to use the unzipped database 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