Image
Top
Navigation
January 11, 2013

Importing large .sql files into phpMyAdmin under MAMP

Ugh. I hate it when I’m trying to make modifications to an existing site and I can’t get the database to import because it’s too large. You end up with a lovely warning message like this:

Screen shot 2013-01-11 at 4.50.43 PM

This happens to me quite often, and I finally found a workaround for this within my local MAMP dev environment.

1. Open up the config.inc.php file within the phpmyadmin dir with your favorite code editor. In your local MAMP environment, it should be located here:

Hard Drive » Applications » MAMP » bin » config.inc.php

2. Do a search for the phrase $cfg[‘UploadDir’] – it’s going to look like this:

$cfg['UploadDir'] = '';

3. Change it to look like this:

$cfg['UploadDir'] = 'upload';

4. Then, within that phpmyadmin dir, create a new folder & name it upload.

5. Take that large .sql file that you’re trying to import, and put it in that new upload folder.

6. Now, the next time you go to import a database into phpMyAdmin, you’ll see a new dropdown field right below the standard browse area in your “File to Import” section, like this:

Screen shot 2013-01-11 at 5.21.45 PM

Select that dropdown, and your file will show up right there. Hilight the db, and hit “Import” – and you’re golden!

Comments

  1. raul

    Simply awesome! very good solution to my problem.

    Thanks a lot

  2. Brilliant, I just upped the execution time and off we go!

  3. Rich Carthew

    Nice job Gregg.

    I too just upgraded to MAMP 4 and can double confirm that this still works. Present me gives past & present you a big thumbs up 🙂

  4. Anurag Shah

    Thanks for the help Gregg! Saved hours was looking for increasing the limit in php.ini file.

    🙂

  5. Meena

    BRILLIANT!
    Thank you, thank you!

  6. Exactly what I was looking for! Thanks.

Submit a Comment

Posted By

Categories

blog