Import single database from --all-databases dump

前端 未结 3 618
谎友^
谎友^ 2020-12-22 15:54

Is it possible to import a single database from an --all-databases mysqldump? I guess I can modify the file manually but wondering if there are any command line options to d

3条回答
  •  暖寄归人
    2020-12-22 16:32

    mysqldump output is just a set of SQL statements.

    You can provide the desired database in the command line and skip the commands against the other databases using:

    mysql -D mydatabase -o mydatabase < dump.sql
    

    This will only execute the commands when mydatabase is in use

提交回复
热议问题