创建mysql数据表 错误语句:
create table blog_article(id int(11) not null UNSIGNED primary key auto_increment,typeid varchar(250),title varchar(250), content text not null,author varchar(250),leavetime int(11));
错误提示 mysql的提示还真够让你折腾的
mysql> create table blog_comment(id int(11) not null UNSIGNED primary key auto_increment,article_id int(11) UNSIGNED,username varchar(250), time int(11) UNSIGNED,pid int(11)); ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right synta x to use near ‘UNSIGNED primary key auto_increment,article_id int(11) UNSIGNED,username varchar‘ at line 1
这里的错误是由于unsigned 的位置放错造成的,unsigned应该放在数据类型的第一位,不然会提示错误
正确语句:
create table blog_article(id int(11) UNSIGNED not null primary key auto_increment,typeid varchar(250),title varchar(250), content text not null,author varchar(250),leavetime int(11));
本文出自 “Freax” 博客,请务必保留此出处http://freax.blog.51cto.com/6614733/1381809
创建数据表添加unsigned时需要注意的,布布扣,bubuko.com
原文:http://freax.blog.51cto.com/6614733/1381809