简体   繁体   English

mysqldump备份丢失了所有的innodb表,但是没有MyISAM表

[英]mysqldump backup is missing all innodb tables but not MyISAM tables

Here are the switches I'm using with mysqldump to backup my database: 这是我与mysqldump一起用来备份数据库的开关:

/usr/bin/mysqldump -u **** --password=**** --single-transaction --database ****  > /filepath/filename.sql

I'm importing into my local database using windows (server is linux) with: 我正在使用Windows(服务器是linux)导入本地数据库:

mysql -u root 

use databasename

source c:/filepath/filename.sql

when I compare the server database verse the local, innodb tables are missing, below is the result of 'show engines;' 当我比较服务器数据库和本地数据库时,缺少innodb表,以下是“显示引擎”的结果; on the local database: 在本地数据库上:

显示引擎

It could be the --single-transaction option. 它可能是--single-transaction选项。 Is it possible that you're altering the table while you did the dump? 进行转储时是否可能要更改表? If so the alter table would be done outside of the transaction. 如果是这样,则alter table将在事务之外完成。 It will create a temporary table, drop the original and rename the temp table. 它将创建一个临时表,删除原始表并重命名临时表。 Since the original table is "gone", it will not be put in the dump file. 由于原始表已“消失”,因此不会将其放入转储文件中。

You can try using --lock-tables instead and see if that works. 您可以尝试使用--lock-tables代替,看看是否可行。

最后,我通过完全擦除本地数据库然后从备份中重新加载数据库来解决此问题,不知道为什么本地数据库未显示innodb表,但已修复

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM