Is there a way to make an entire MySQL row unique

You can make a unique index that includes all of the columns in your table

ALTER TABLE buyers ADD UNIQUE idx_row_unique(first_name,last_name,...);

This way you can keep a unique AUTO INCREMENT primary key for join purposes, while still ensuring that all of the data in your table is unique.


You need a composite primary key.

A composite primary key tells MySQL that you want your primary key to be a combination of fields.

More info here: Why use multiple columns as primary keys (composite primary key)

Tags:

Mysql

Unique