Sell And Buy

Wednesday 25 March 2015

Importing large files through phpMyAdmin on xampp installation

Like it’s described in title in this post I’ll try to describe how to increase the maximum file size for importing database on xampp instalation.

Situation

You installed Xampp and you want to import existing data from other installation or from host. First you need to export the data. In this case I’m using wordpress installation and I want to have copy of my whole site on local install just to have some materials during web development.

Step 1 : Exporting the data

Go to your phpMyAdmin from cPanel or type: localhost/phpmyadmin in your browser if you want to extract from xampp installation. Open database and go to extract, choose “quick” or “custom” and format, sql is preferred. After download is complete send file in .zip format or leave it as is.

Step 2 : Import the data

It’s the best solution to open new, clean database, and import the file in phpMyAdmin. Choose file from local folder and leave all settings as is. That should be it.
But if your file exceeded file size of 2MB (that is default value in xampp installation) than you need to tweak some out. Basically we will just increase the maximum upload file size.
Open your xampp install folder and go to php folder. With some text editor file (notepad++) open the file called php.ini (by type windows describe it as configuration settings) and edit the line (cca. 770, or press ctrl+f  in notepad++ to find it):
post_max_size = 2M
instead 2M, put wanted maximum file size (16MB for example but not higher than 128M), after that go to this line:
max_execution_time = 30
instead 30, increase execution time that’s in seconds (90 for example), also you need to change this line:
max_input_time = 60
instead 60, increase input time in seconds (120 for example)
and top of all you have to change this line:
upload_max_filesize = 2M
instead of 2M, increase to 16M for example.
Save the file, restart apache and mysql in xampp and try to upload again, if you follow correctly you should be able to import files through 16MB (example)

No comments:

Post a Comment