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
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
Step 1: Find the
config.inc.php
file located in the phpmyadmin directory. In my case it is located here: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:Step 3: Create a directory called ‘upload’ within the phpmyadmin directory.
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.
I suggest you'd definitely use mysql command prompt that would be faster option. because there are limitation in phpmyadmin UI and browsers itself for process request
following are steps to use mysql command line.
doesnt matter if you user xampp/wamp/mamp
search for bin folder path is system dir/(xampp/wamp)/mysql/bin
then user following command
"mysql-u root -p -h localhost" press enter system will ask for password press enter again
finally you're in
please use command "use Database_name" to point to specific database and you're good to go
if you want to upload database in to for ex. temp table
then follow these steps
this will upload sql file database in temp db
if you didnt get any part from this then please pm me i'll definitely help you out.
Mitesh
I also face the same problem and strangely changing the values in php.ini did not worked for me. So I found out one more solution which worked for me.
Once mysql console is open. Enter your mysql password. and give these commands.
If you still have problems watch this video.
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:You can do it in following ways;
You can go to control panel/cpanel and add host % It means now the database server can be accessed from your local machine. Now you can install and use MySQL Administrator or Navicat to import and export database with out using PHP-Myadmin, I used it several times to upload 200 MB to 500 MB of data with no issues
Use gzip, bzip2 compressions for exporting and importing. I am using PEA ZIP software (free) in Windows. Try to avoid Winrar and Winzip
Use MySQL Splitter that splits up the sql file into several parts. In my personal suggestion, Not recommended
Using PHP INI setting (dynamically change the max upload and max execution time) as already mentioned by other friends is fruitful but not always.
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.
You can also try below command from command prompt, your path may be different as per your MySQL installation.
if you have much bigger db than increase the
max_allowed_packet
of mysql inmy.ini
to avoidMySQL server gone away
error, something like this