如何在phpmyadmin中导入时跳过重复记录 [英] how to skip duplicate records when importing in phpmyadmin
问题描述
我在我的本地机器上有一个数据库,我想将数据导入我托管的数据库。两个db都是相同的,相同的表名
,列名
等。
当我导出
表从我的本地db通过 phpmyadmin
和导入
它通过phpmyadmin在我的主机上一个错误弹出告诉我有重复的条目为主键
并停止整个操作。 p>
如何通过phpmyadmin导入数据,跳过重复的条目,并在过程结束时显示重复的列表?
我可以做的一个解决方案是在我的主机调用db中的主键的所有值,并在导入之前过滤重复的值。
在phpMyAdmin中,在设置标签中,您可以尝试检查以下值:
- 设置 - > SQL查询 - >忽略多个语句错误
如果您使用的是CSV格式:
- 设置 - >导入 - > CSV - >不中止INSERT错误
如果使用SQL格式:
- 设置 - >导出 - > SQL - >使用忽略插入
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.
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.
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?
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?
In phpMyAdmin , in Settings tab, you can try checking the following values:
- Settings -> SQL Queries -> Ignore multiple statement errors
If you are using CSV format:
- Settings -> Import -> CSV -> Do not abort on INSERT error
If you are using SQL format:
- Settings -> Export -> SQL -> Use ignore inserts
这篇关于如何在phpmyadmin中导入时跳过重复记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!