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

前端 未结 13 2042
旧巷少年郎
旧巷少年郎 2020-12-04 09:46

I want to import over 1GB size sql file to MySQL database in localhost WAMP/phpmyadmin. But phpmyadmin UI doesn\'t allow

13条回答
  •  猫巷女王i
    2020-12-04 10:31

    If you will try to load such a large file through phpmyadmin then you would need to change upload_file_size in php.ini to your requirements and then after uploading you will have to revert it back. What will happen? If you would like to load a 3GB file. You will have to change those parameters in php.ini again.

    The best solution to solve this issue to open command prompt in windows.

    Find path of wamp mysql directory.

    Usually, it is C:/wamp64/bin/mysql/mysqlversion/bin/mysql.exe

    Execute mysql -u root

    You will be in mysql command prompt

    Switch database with use command.

    mysql> use database_name
    mysql> source [file_path]
    

    In case of Windows, here is the example.

    mysql> source C:/sqls/sql1GB.sql
    

    That's it. If you will have a database over 10GB or 1000GB. This method will still work for you.

提交回复
热议问题