如何导入MySQL的不良转储时跳过一行 [英] How to skip row when importing bad MySQL dump

查看:183
本文介绍了如何导入MySQL的不良转储时跳过一行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由于糟糕的 mysqldump的,导致对进口的错误:

Given bad mysqldump that causes error on import:

namtar backups # mysql -p < 2010-12-01.sql
Enter password: 
ERROR 1062 (23000) at line 8020: Duplicate entry 'l�he?' for key 'wrd_txt'

有没有一种简单的方法来告诉进口跳过给定的行,并继续?

Is there an easy way to tell import to just skip given row and continue?

(是的,我知道我可以手动编辑该文件或输出的解析,但它不是十分便利)

(Yes, I know I can manually edit the file or parse output, but it's not very convinient)

推荐答案

如果你可以转储再次,你可以卸载时添加--insert-忽略的命令行。

If you can make the dump again you could add --insert-ignore to the commandline when dumping.

或者你可以尝试使用带--force的命令的mysqlimport,这将继续即使遇到MySQL的错误。

Or you can try using the mysqlimport command with --force,which will continue even if it encounters MySQL Errors.

这篇关于如何导入MySQL的不良转储时跳过一行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆