[英]MySQL restoring a database via mysqldump - Does it overwrite the different destination tables?
I am using mysqldump to backup a database containing several tables (say tables D, E, F). 我使用mysqldump来备份包含几个表的数据库(比如表D,E,F)。 I use the following command: mysqldump -uuser -ppassword SourceDatabase > file.sql to backup these tables. 我使用以下命令:mysqldump -uuser -ppassword SourceDatabase> file.sql来备份这些表。
I would like to know if I restored this backup, would it overwrite other tables? 我想知道如果我恢复了这个备份,它会覆盖其他表吗? For example, if I have a database DestinationDatabase, containing tables A, B and C, and after running the command "mysql -uuser -ppassword DestinationDatabase < file.sql", would I lose the tables A, B and C on the destination database (and be left with just D, E and F) or would I be left with A, B, C, D, E and F (with the original tables present in DestinationDatabase left untouched)? 例如,如果我有一个包含表A,B和C的数据库DestinationDatabase,并且在运行命令“mysql -uuser -ppassword DestinationDatabase <file.sql”之后,我将丢失目标数据库上的表A,B和C. (并留下D,E和F)或者我会留下A,B,C,D,E和F(DestinationDatabase中的原始表格保持不变)?
Thanks in advance, Tim 蒂姆,提前谢谢
它取决于执行备份时选项add-drop-table
和add-drop-database
的值。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.