在phpmyadmin中导入时如何跳过重复记录 [英] how to skip duplicate records when importing in phpmyadmin

查看:54
本文介绍了在phpmyadmin中导入时如何跳过重复记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的本​​地机器上有一个数据库,我想将数据导入我的主机上的数据库.两个数据库是相同的,相同的表名列名

I have a db on my local machine and I want to import the data to the db on my hosting. Both db's are identical, the same table names, column names, etc.

当我通过 phpmyadmin 从我的本地数据库exportimport 它通过我主机上的 phpmyadmin 时,会弹出一个错误,告诉我primary key 有重复的条目并停止整个操作.

When I export the table from my local db through phpmyadmin and import it through phpmyadmin on my hosting an error pops up telling me that there are duplicate entries for the primary key and stops the whole operation.

如何通过phpmyadmin导入数据,跳过重复的条目,并在流程结束时显示重复的列表?

How can I import the data through phpmyadmin, skip the duplicate entries, and display a list of the duplicates at the end of the process?

我可以做的一个解决方案是在我的主机上调用数据库中主键的所有值,并在导入之前过滤重复项.但我想知道 phpmyadmin 是否有快速解决方案?

A solution that I can do is call all the values of the primary key in the db at my hosting and filter the duplicates before import. BUT I am wondering if there is a quick solution for this with phpmyadmin?

推荐答案

在 phpMyAdmin 的 Settings 选项卡中,您可以尝试检查以下值:

In phpMyAdmin , in Settings tab, you can try checking the following values:

  • 设置 -> SQL 查询 -> 忽略多个语句错误

如果您使用的是 CSV 格式:

If you are using CSV format:

  • 设置 -> 导入 -> CSV -> 不要因插入错误而中止

如果您使用的是 SQL 格式:

If you are using SQL format:

  • 设置 -> 导出 -> SQL -> 使用忽略插入

这篇关于在phpmyadmin中导入时如何跳过重复记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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