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 ?Answers
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
if you have much bigger db than increase the
max_allowed_packet
of mysql in
my.ini
to avoid MySQL server gone away
error, something like thismax_allowed_packet = 100M
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
What are the possible ways to do that such as any SQL query to import .sql file ?
Try this
mysql -u<user> -p<password> <database name> < /path/to/dump.sql
assuming
dump.sql
is your 1 GB dump file
Make sure to check the phpMyAdmin config file as well! On newer
WAMP applications it is set to 128Mb by default. Even if you update php.ini
to desired values you still need to update the phpmyadmin.conf!
Sample path: C:\wamp64\alias\phpmyadmin.conf
Or edit through your WAMP icon by: ->Apache -> Alias directories -> phpMyAdmin
You can do it in following ways;
You can go to control panel/cpanel and add host % It means now the Use gzip, bzip2 compressions for exporting and importing. I am using PEA ZIP
Use MySQL Splitter that splits up the sql file into several parts. In my personal suggestion,
Using PHP INI setting (dynamically change the max upload and max execution time) as
0 comments:
Post a Comment