在springboot 项目开始执行如下建表语句时
DROP TABLE IF EXISTS `auto_user`;
create table `auto_user` (
`id` int primary key auto_increment,
`name` varchar(32) not null default '',
`age` int not null default 0
)
一直报如下错误:
后来查找发现是 设置主键不能写在定义字段中,要单独定义主键
DROP TABLE IF EXISTS `auto_user`;
create table `auto_user` (
`id` int auto_increment,
`name` varchar(32) not null default '',
`age` int not null default 0,
primary key (`id`)
);