Auto Increment varchar in MySQL

前端 未结 4 924
眼角桃花
眼角桃花 2021-01-19 07:07

Is there a way to set primary key auto increment, type of varchar in mySql?

4条回答
  •  南笙
    南笙 (楼主)
    2021-01-19 07:37

    Duplication of MySQL - how to use VARCHAR as AUTO INCREMENT Primary Key

    According to my point of view you have to change it as integer type. Since AUTO_INCREMENT is for INT type only, moreover setting the field as PRIMARY KEY which prevents duplication of values.

提交回复
热议问题