Importing Large Databases Into MAMP

Importing Large Databases Into MAMP

Robert ShellApril 08, 2015


 MAMP is a great tool for running servers locally, however, when you must export that site you have been developing locally and your database is huge, then you could have some problems with PHPMyAdmin.



Step One:

  • Open a new terminal window
  • CAREFUL: This will replace all tables in the database you specify!

Step Two:

  • /applications/MAMP/library/bin/mysql -u [USERNAME] -p [DATABASE_NAME] < [PATH_TO_SQL_FILE]
  • Hit the Enter Key
  • Example:
  • /applications/MAMP/library/bin/mysql -u root -p wordpress_db < /Applications/MAMP/htdocs/backupDB.sql
  • Quick Tip: Don’t forget that you can simply drag the file into the terminal window and it will enter the location of the file for you.

Step Three:

  • You should be prompted with the following line:
  • Enter password:
  • Type your password, keep in mind that the letters will not appear, but they are there
  • Hit the enter key

Step Four:

  • Check if you database was successfully imported
  • Navigate to phpMyAdmin in a browser
  • http://localhost:8888/MAMP/