Tuesday, November 15, 2011

mysql add AUTO_INCREMENT

1, if the table no primary key, you need add primary key first

mysql> alter table blacklist add primary key (alarmID) ;

2, mysql> alter table blacklist modify alarmID int(10) unsigned AUTO_INCREMENT, AUTO_INCREMENT=50000;

No comments:

Post a Comment