创建数据表添加unsigned时需要注意的
2014-03-23 17:00
429 查看
创建mysql数据表 错误语句:
正确语句:
本文出自 “Freax” 博客,请务必保留此出处http://freax.blog.51cto.com/6614733/1381809
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
相关文章推荐
- E-mail中的域名和DNS相关知识(A记录,MX记录)
- 2013多校联合3 G The Unsolvable Problem(hdu 4627)
- Java GUI textfield+JOptionPane
- OCM_Session7_10_安装clusterware
- 在ASP.NET MVC应用程序中随机获取一个字符串
- matlab遗传算法工具箱函数及实例讲解
- linux知识点
- 离散数学命题逻辑之p->q
- Java Beginners FAQ
- Failed to initialize component [Connector[HTTP/1.1-8086]]
- 最大子序列和
- 状态压缩DP总结
- Out输出对象clear(),clearBuffer()和flush()的区别
- 总结之:CentOS 6.5 HTTPD服务的全面解读及配置详解(1)
- Basic Level 1016. 部分A+B (15)
- Android - Android Studio修改字体(font)大小(size)
- IBM AIX6.1上安装OpenSSH手记
- Android - Android Studio修改字体(font)大小(size)
- qt 中文乱码
- CSS+DIV布局初练—DIV元素必须成对出现?