MySQL之建表时[Err] 1050 - Table ‘users‘ already exists异常解决方法
·
当执行MySQL新建表格table时:
例如:
create table students(
uid int not null auto_increment,
uname varchar(30) not null,
uage int not null,
primary key (uid)
);
出现[Err] 1050 - Table ‘students’ already exists异常时,
经常报错:Table ‘users’ already exists
报错原因:创建表格重复
解决方法:添加 if not exists
create table if not exists students(
uid int not null auto_increment,
uname varchar(30) not null,
uage int not null,
primary key (uid)
);
更多推荐
已为社区贡献9条内容
所有评论(0)