Articles on: FiveM

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

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

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.

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.

Updated on: 09/05/2022

Was this article helpful?

Share your feedback


Thank you!