Import SQL file by command line in Windows 7

前端 未结 16 1505
攒了一身酷
攒了一身酷 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:34

    To import database from dump file (in this case called filename.sql)

        use: mysql -u username -p password database_name < filename.sql 
    

    you are on Windows you will need to open CMD and go to directory where mysql.exe is installed. you are using WAMP server then this is usually located in: C:\wamp\bin\mysql\mysql5.5.8\bin (*note the version of mysql might be different)

    So you will: cd C:\wamp\bin\mysql\mysql5.5.8\bin

    and then execute one of the above commands. Final command like this

        C:\wamp\bin\mysql\mysql5.5.8\bin>mysql -u rootss -p pwdroot testdatabasename < D:\test\Projects\test_demo_db.sql
    

提交回复
热议问题