Modify column to auto_increment
Hi,
I want to modify an existing table column to auto-increment, and I have tried these but I get error :
mysql> ALTER TABLE lz_chat_archive_dup2 MODIFY COLUMN chat_id INT(10) AUTO_INCREMENT;
ERROR 1075 (42000): Incorrect table definition; there can be only one auto column and it must be defined as a key
mysql> ALTER TABLE lz_chat_archive_dup2 MODIFY COLUMN chat_id INT(10) AUTO_INCREMENT KEY;
ERROR 1265 (01000): Data truncated for column 'chat_id' at row 12
How do I resolve this?
Subject
Views
Written By
Posted
Modify column to auto_increment
1006
August 14, 2020 11:47PM
376
August 15, 2020 09:15AM
384
August 16, 2020 02:38AM
478
August 16, 2020 07:40AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.