SQL Error: Duplicate entry 'xxxxxxx' for key 'PRIMARY' (or else)

FiveMĐọc 1 phútCập nhật 28 thg 8, 2026

Do you get the error Duplicate entry 'societypolice' for key 'PRIMARY' while importing an SQL file? We will explain why this happens, and how to avoid this!

Of course, 'societypolice' can be another name in your case

  1. The first reason why this is happening, is because you are importing an SQL file for the second time, and all tables are already filled up with data. Because the PRIMARY key in this table is a name, and not an auto incrementing number. Primary keys cannot be duplicate, so check the table, and delete the row that already exists.
  2. You have a bad SQL file with duplicate INSERT rows. Try to remove the duplicates, or contact the creator of the SQL file to fix this.

We hope this makes it a little bit more clear, why this is actually happening.

Nội dung này có giải quyết được vấn đề không?

Vẫn chưa giải quyết được?

Đội ngũ hỗ trợ của chúng tôi thật sự am hiểu các game mà chúng tôi lưu trữ. Mở ticket và chúng ta sẽ cùng xử lý.

Mở ticket