mysql, dump, database restore

后端 未结 3 433
终归单人心
终归单人心 2021-02-02 10:53

I have dumped my database with the following command:

mysqldump -uuser -ppassword db_name > file

then I completely removed my database:

3条回答
  •  半阙折子戏
    2021-02-02 11:05

    I tried dump of my database with the following commands:

    #mysqldump -u  -p  DB_name > .sql
    

    Then login into the DB:

       #mysql -u  -p 
       >show databases;
       >drop database ;
    

    Then create a new database:

    #create database ;
    

    DB_name is userdefined name we can have any name.

    and then restore the DB with the following command:

    #mysql -u  -p  DB_name < .sql
    

提交回复
热议问题