Chicago, IL | p: 773.338.1313
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:
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:
Select that dropdown, and your file will show up right there. Hilight the db, and hit “Import” – and you’re golden!
Thanks for putting this on the internet! Just helped me immensely today. Found also that you must choose it from the dropdown; browsing and selecting the file in the approved upload directory doesn’t work. Doing it right, as you explained, does however work.
It worked! Got it right first time!
Thanks so much for a great tip.
Thank you!! You saved thousands of productive minutes ๐
Awesome tip! Thanks a bunch!!
Beautiful!
Wow… thanks dude, your post helped me to import my 100+ MB database which is having a huge wallpapers pics database. I have followed your steps and imported the data successfully.
Thanks,
Is this possible with xammp? I have it working on my mamp, but i would like to get it working with xammp as well. Any Suggestions?
Thanks for this! Worked like a charm. ๐
You’re an angel! Thanks
Thanks a lot. It was a great help.
While looking for this mamp tutorial I found the one for xampp here http://p3php.in/import-large-sql-file-from-phpmyadmin/
Great tut by the way!
Thank u so much am able to load large SQL file.
I spent hours looking for a way to upload a large file!
Which I’d come her First!!
Thank you so much!
Gregg, Your trick saved my time. It worked. Before this I always use some other way like:- I do increase some limit variables size int the php.ini file.
Today I applied your trick and it worked and I got smile ๐
Tons of thanks,
Vishnu
Great workaround. Thanks for sharing this. ๐
For anyone that is looking for the “config.inc.php” file in a newer version of MAMP, look in “/Applications/MAMP/bin/phpMyAdmin/”
Thanks a lot, this was exactly what I needed. For me, the config.inc.php file was in Hard Drive ยป Applications ยป MAMP ยป bin ยป phpmyadmin ยป config.inc.php
Thanks so much for this. Saved me HOURS.
Thanks a lot Gregg! It really helped me out. Amazing how simple the solution is and how you figured it out. Thanks for posting it on the web! Cheers!
wow…it works for me too
thanks for sharing
Another happy camper. Thank you!
nice
Yay! Thanks a lot!
Great link this solves our problem.
I got this error: phpMyAdmin – Error
Wrong permissions on configuration file, should not be world writable!
How to solve that ?
Thank You in advance
thank you! Thank you! Thank you! Your fix worked. Really appreciate this bud.
Is it too strong to say I love you for writing this up. Thank you so much, I really did not have time too work this out for myself.
This worked perfectly.
Thanks again
It’s NOT too strong to say I love you for this post!! You saved my day. It’s stupid to try to upload a file in a local directory and it was taking all day. Now it’s instant. I LOVE YOU!! ๐
Thanks you so much
Today was a great day after reading this post and successfully importing my troublesomely large database. Can’t thank you enough!!
Excellent!
Worked perfectly, thanks for the tut.
excellent suggestion – it increased my load of same size database at least 5x faster than before I saw this article
Gregg – Super post and saved my life as I am working on a clients database that is 2.9GB and needs cleaning out!
Awesome! Very helpful- thanks for sharing Gregg.
Tried several other methods…this one worked with ease! Sweet work-around, thanks!!!
Bro’…. (because with this you are my bro’)…
You make my day… with a drupal sql (1.56 go), i have sucessfull upload (using a lot aof resume) this base to convert it into wordpress (match posts,users,etc…)
Like all other… love 4 U !!
Regards
Thanks!!!!
I was able to follow the tutorial and get to the part where we can now upload via the checkbox for the new upload field. However, when I went ahead and selected my file (it’s a 49.5MB total size SQL), I got an error on import saying that some packet exceeded max uploaded packet size. Any ideas? I’m pretty much trying to make an exact copy of my live site, to a local environment but not with much success.
Thanks so much, simplest tutorial yet…a useful note to add, I found several config.inc.php files in my mamp installation, I edited the one I found in this path: mamp/bin/phpMyAdmin/ and not as specified straight in the bin directory….
It worked perfectly. I couldn’t search for the full phrase so I just searched for the first part $cfg[‘UploadDir’] as in my config.inc.php file there is a lot of space before the = ”;
Hugely appreciated. Thanks
This worked, yay! Thanks…
Thank you!
You are a genius! Been searching for a solution for ages, thanks so much for this ๐ ๐
WOW Awesome! thanks
Thanks! This is much easier than using the terminal (IMO).
Just a word to those who already have MAMP running; you need to stop and restart the servers before otherwise you’ll get a Error: 1046 SQLSTATE (ER_NO_DB_ERROR) no database selected error. Just in case anyone was having that problem!
hi there, I have got to the point where I have made the upload file and it is a visible option to import. I have copied the backup file into the folder but phpmyadmin does not show it and says no file available on server. tried both zip and folder. I am new to this so I appreciate the help
Much appreciated!!!
This is the most helpful thing on the internet.
Oh man… Thank you!
Thanks a lot – it worked. Just for the semi illiterate like myself, don’t forget to read that you need to find the file ‘config.inc.php’ inside the phpmyadmin directory which is inside the bin directory. Full path is:
Hard Drive ยป Applications ยป MAMP ยป bin ยป phpMyAdmin >> config.inc.php
Thanks it worked
Categories
Comments