Pinch
Pinch

Reputation: 2888

Mysql table running out of ids

We have a mysql table that is running out of ids soon (the primary id is a 32-bit integer and the max id is already about 1.5 billion). What is the best way to fix this issue? Alter the id type to 64-bit is an option but that would bring down the database for too long because the table has billion of rows.

Upvotes: 7

Views: 1466

Answers (2)

Iresha Rubasinghe
Iresha Rubasinghe

Reputation: 953

then try changing the type of the field. Try some type with a big range like "BIGINT".

Upvotes: 3

RiggsFolly
RiggsFolly

Reputation: 94682

All versions of MYSQL (both 32bit and 64bit) use an 8 byte field for a column defined as BIGINT.

So amend the column to be BIGINT

Check the documentation

Upvotes: 3

Related Questions