Restoring a MySQL table back to the database

后端 未结 4 926
栀梦
栀梦 2021-02-04 01:36

I have a trouble in restoring MySQL table back to the database from command line. Taking backup of a table is working with mysqldump.Taking backup and restoring of a database i

4条回答
  •  野的像风
    2021-02-04 02:06

    Ah, I think I see the problem here.

    Your backup script looks fine. tbl_name works correctly as the optional 2nd argument.

    To restore, you should simply run

    mysql -uroot -p DatabaseName < path\TableName.sql
    

    Running man mysql would have shown you the correct arguments and options

    mysql [options] db_name

    As your backup script only contains one table, only that table will be restored into your database.

提交回复
热议问题