Import SQL file by command line in Windows 7

前端 未结 16 1850
攒了一身酷
攒了一身酷 2021-01-30 11:20

I want to import an SQL file (size > 500MB) into a database. I have wamp on my PC. Phpmyadmin does not work well with this size. I changed all parameters in php.ini (max_upload_

16条回答
  •  忘了有多久
    2021-01-30 11:32

    If you are running WampServer on your local machine, import means restoring the dump file that you have (in sql format)

    Here are the steps

    1. Go to command line by going to Start -> Run and typing in cmd.
    2. Change the directory to Mysql bin directory. It will be like

      c:\wamp\bin\mysql\mysql5.7.14\bin

    3. It would be better to keep the dump file in the above directory( we can delete, after restoration)

    4. Hope you have created the database (either through phpMyadmin or using command line)

    5. Then type the command mysql.exe -u root -p databasename < filename.sql

    Please note the difference, it is 'mysql.exe' not 'mysql'

提交回复
热议问题