Can't import database through phpmyadmin file size too large
For Upload large size data in using phpmyadminDo following steps.
- Open php.ini file from C:\wamp\bin\apache\Apache2.4.4\bin Updatefollowing lines
than after restart wamp server or restart all services Now Uploaddata using import function in phymyadmin. Apply second step iftill not upload data.max_execution_time = 259200max_input_time = 259200memory_limit = 1000Mupload_max_filesize = 750Mpost_max_size = 750M
- open config.default.php file inc:\wamp\apps\phpmyadmin4.0.4\libraries (Open this file accoringto phpmyadmin version)
Find$cfg['ExecTimeLimit'] = 300;
Replace to$cfg['ExecTimeLimit'] = 0;
Now you can upload data.
You can also upload large size database using MySQL Console as below.
- Click on WampServer Icon -> MySQL -> MySQL Consol
- Enter your database password like
root
in popup - Select database name for insert data by writing command
USE DATABASENAME
- Then load source sql file as
SOURCE C:\FOLDER\database.sql
- Press enter for insert data.
Note: You can't load a compressed database file e.g. database.sql.zip
or database.sql.gz
, you have to extract it first. Otherwise the console will just crash.
Its due to PHP that has a file size restriction for uploads.
If you have terminal/shell access then the above answers @Kyotoweb will work.
one way to get it done is that you create an .htaccess/ini file file to change PHP settings to get the sql file uploaded through PHPmyAdmin.
php_value upload_max_filesize 120M //file sizephp_value post_max_size 120Mphp_value max_execution_time 200php_value max_input_time 200
Note you should remove this file after upload.
Here is what I've done:
- Gone to my XAMPP installed directoy
C:\xampp\php
- Open the "Configuration Settings" file named
php.ini
using your text editor, preferably you can also you Notepad for Windows machine. - Somewhere nearby on line no 886, please update it to
upload_max_filesize = 128M
- Similarly on line no 735
post_max_size = 128M
- On line no 442
max_execution_time = 300
- On line no 452
max_input_time = 60
- Restart your Apache from either XAMPP Control Panel or using CMD in Windows https://stackoverflow.com/a/6723485/969092
Done!