Clone MySQL database

前端 未结 7 785
攒了一身酷
攒了一身酷 2020-12-12 13:37

I have database on a server with 120 tables.

I want to clone the whole database with a new db name and the copied data.

Is there an efficient way to do this?

7条回答
  •  离开以前
    2020-12-12 14:33

    $ mysqldump yourFirstDatabase -u user -ppassword > yourDatabase.sql
    $ mysql yourSecondDatabase -u user -ppassword < yourDatabase.sql
    

提交回复
热议问题