Skip to content

Instantly share code, notes, and snippets.

@alekskravchenko
Forked from MrCoker/howto.md
Created March 3, 2022 20:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alekskravchenko/20a0e29d09a051b7f8cd88280b7a9a25 to your computer and use it in GitHub Desktop.
Save alekskravchenko/20a0e29d09a051b7f8cd88280b7a9a25 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