mysql 创建自增主键id

CREATE TABLE `tb_slink` (
  `id` int(11) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

ALTER TABLE `tb_slink`
  ADD PRIMARY KEY (`id`);


ALTER TABLE `tb_slink`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

  

 
posted @ 2020-12-03 23:02  zhenw0  Views(1844)  Comments(0Edit  收藏  举报