Import SQL file into mysql

前端 未结 18 1433
盖世英雄少女心
盖世英雄少女心 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:11

    I have installed my wamp server in D: drive so u have to go to the following path from ur command line->(and if u have installed ur wamp in c: drive then just replace the d: wtih c: here)

    D:\>cd wamp
    D:\wamp>cd bin
    D:\wamp\bin>cd mysql
    D:\wamp\bin\mysql>cd mysql5.5.8 (whatever ur verserion will be displayed here use keyboard Tab button)
    D:\wamp\bin\mysql\mysql5.5.8>cd bin
    D:\wamp\bin\mysql\mysql5.5.8\bin>mysql -u root -p password db_name < "d:\backupfile.sql"
    

    here root is user of my phpmyadmin password is the password for phpmyadmin so if u haven't set any password for root just nothing type at that place, db_name is the database (for which database u r taking the backup) ,backupfile.sql is the file from which u want ur backup of ur database and u can also change the backup file location(d:\backupfile.sql) from to any other place on your computer

提交回复
热议问题