mysqlsqlphpmyadminwamp

How to Import 1GB .sql file to WAMP/phpmyadmin


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


Solution

  • 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