I want to import over 1GB size sql
file to MySQL
database in localhost WAMP/phpmyadmin
. But phpmyadmin
UI doesn't allow to import such big file.
What are the possible ways to do that such as any SQL
query to import .sql file ?
Thanks
After opening the command line interface, you will be prompted to enter a password, just press enter in case you don't have a password. The next command is “source” followed by the path to the database you want to import and then press enter to start importing. Thanks for reading this and my other medium stories.
I suspect you will be able to import 1 GB file through phpmyadmin But you can try by increasing the following value in php.ini and restart the wamp.
post_max_size=1280M
upload_max_filesize=1280M
max_execution_time = 300 //increase time as per your server requirement.
You can also try below command from command prompt, your path may be different as per your MySQL installation.
C:\wamp\bin\mysql\mysql5.5.24\bin\mysql.exe -u root -p db_name < C:\some_path\your_sql_file.sql
You should increase the max_allowed_packet
of mysql in my.ini
to avoid MySQL server gone away
error, something like this
max_allowed_packet = 100M
Step 1:
Find the config.inc.php
file located in the phpmyadmin directory. In my case it is located here:
C:\wamp\apps\phpmyadmin3.4.5\config.inc.php
Note: phymyadmin3.4.5 folder name is different in different version of wamp
Step 2:
Find the line with $cfg['UploadDir']
on it and update it to:
$cfg['UploadDir'] = 'upload';
Step 3: Create a directory called ‘upload’ within the phpmyadmin directory.
C:\wamp\apps\phpmyadmin3.2.0.1\upload\
Step 4: Copy and paste the large sql file into upload directory which you want importing to phymyadmin
Step 5: Select sql file from drop down list from phymyadmin to import.
The values indicated by Ram Sharma might need to be changed in Wamp alias configuration files instead.
In <wamp_dir>/alias/phpmyadmin.conf
, in the <Directory>
section:
php_admin_value upload_max_filesize 1280M
php_admin_value post_max_size 1280M
php_admin_value max_execution_time 1800
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With