Import SQL file into mysql

前端 未结 18 1442
盖世英雄少女心
盖世英雄少女心 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条回答
  •  萌比男神i
    2020-11-28 01:13

    If you are using wamp you can try this. Just type use your_Database_name first.

    1. Click your wamp server icon then look for MYSQL > MSQL Console then run it.

    2. If you dont have password, just hit enter and type :

      mysql> use database_name;
      mysql> source location_of_your_file;
      

      If you have password, you will promt to enter a password. Enter you password first then type:

      mysql> use database_name;
      mysql> source location_of_your_file;
      

    location_of_your_file should look like C:\mydb.sql

    so the commend is mysql>source C:\mydb.sql;

    This kind of importing sql dump is very helpful for BIG SQL FILE.

    I copied my file mydb.sq to directory C: .It should be capital C: in order to run

    and that's it.

提交回复
热议问题