Import SQL file into mysql

前端 未结 18 1453
盖世英雄少女心
盖世英雄少女心 2020-11-28 00:16

I have a database called nitm. I haven\'t created any tables there. But I have a SQL file which contains all the necessary data for the database. The file is

18条回答
  •  孤独总比滥情好
    2020-11-28 01:10

    For those of you struggling with getting this done trying every possible answer you can find on SO. Here's what worked for me on a VPS running Windows 2012 R2 :

    1. Place your sql file wherever the bin is for me it is located at C:\Program Files\MySQL\MySQL Server 8.0\bin

    2. Open windows command prompt (cmd)

    3. Run C:\Program Files\MySQL\MySQL Server 8.0\bin > mysql -u [username] -p
    4. Enter your password
    5. Run command use [database_name];
    6. Import your file with command source C://Program Files//MySQL//MySQL Server 8.0//bin//mydatabasename.sql

    It did it for me as everything else had failed. It might help you too.

提交回复
热议问题