数据库导入数据后发现没有自增 id,因此就有了上面这个问题。
解决方法
1、给某一张表先增加一个字段,这里我们就以 node_table 这张表来举例,在数据库命令行输入下面指令 :
alter table node_table add id int
2、更改 id 字段属性为自增属性,在数据库命令行输入下面指令 :
alter table `node_table` change id id int not null auto_increment primary key;
数据库导入数据后发现没有自增 id,因此就有了上面这个问题。
解决方法
1、给某一张表先增加一个字段,这里我们就以 node_table 这张表来举例,在数据库命令行输入下面指令 :
alter table node_table add id int
2、更改 id 字段属性为自增属性,在数据库命令行输入下面指令 :
alter table `node_table` change id id int not null auto_increment primary key;
MySQl 数据库已有数据的表添加自增 ID?
https://www.luoweihua.cn/archives/12.html