久久福利_99r_国产日韩在线视频_直接看av的网站_中文欧美日韩_久久一

您的位置:首頁技術文章
文章詳情頁

mysql建表報錯,查手冊看不懂,求解?

瀏覽:135日期:2022-06-11 16:56:55

問題描述

mysql建表報錯,查手冊看不懂,求解?

create table abc( id int unsigned primary_key auto_increment, usename char(20) not null default ’’, gender char(1) not null default ’’, weight tinyint unsigned not null default 0, birth date not null default 0, salary decimal(8,2) not null default ’000000.00’, lastlogin timestamp not null default 0, intro varchar(1500) not null default ’’,)engine myisam charset=utf8;

報錯:you have an error in your sql syntax;check the manual that corresponds to your MySQL server version for the right syntax to use near ’primary_key auto_increment,username char(20) not null default ’’,gender c’ at line 3

問題解答

回答1:

創建帶索引的數據庫表需要為表名和屬性添加反單引號,并且你當前的primary key的位置需要調整一下:

create table `abc`( `id` int unsigned auto_increment, `usename` char(20) not null default ’’, `gender` char(1) not null default ’’, `weight` tinyint unsigned not null default 0, `birth` date not null default 0, `salary` decimal(8,2) not null default ’000000.00’, `lastlogin` timestamp not null default 0, `intro` varchar(1500) not null default ’’, primary key (`id`))engine myisam charset=utf8;

我剛剛試了一下,除了primary key其他的屬性和表名不加反單引號也可以,即這樣也是可以的:

create table abc( id int unsigned auto_increment, usename char(20) not null default ’’, gender char(1) not null default ’’, weight tinyint unsigned not null default 0, birth date not null default 0, salary decimal(8,2) not null default ’000000.00’, lastlogin timestamp not null default 0, intro varchar(1500) not null default ’’, primary key (`id`))engine myisam charset=utf8;

參考:mysql創建和刪除表

回答2:

primary_key聲明的不對,樓上解

主站蜘蛛池模板: 久久www免费人成看片高清 | 性培育学校羞耻椅子调教h 欧美精品网站 | 一区二区三区视频播放 | 成人欧美一区二区三区在线播放 | 天操天天干 | 久久中文字幕视频 | 男女羞羞视频网站 | 国产夜夜夜 | 五月在线视频 | 天天射天天干 | 国产一级片 | 在线观看国产视频 | 国产欧美日韩精品一区 | 亚洲精品视频区 | 国产成年免费视频 | 三级黄视频在线观看 | 性色国产| 亚洲精品电影在线观看 | 国产欧美精品一区二区三区四区 | 99精品视频在线观看 | 亚洲欧美中文字幕 | 国产欧美综合一区二区三区 | 精品一区二区三区久久久 | 欧美精品综合 | 国产永久免费 | 狠狠撸在线 | 国产三级| 欧美色综合天天久久综合精品 | 亚洲成人中文字幕 | 欧美精品网站 | 99精彩视频| 免费午夜电影 | 免费一区 | 97久久超碰 | 91av在线免费看 | 国产欧美一区二区精品忘忧草 | 欧美日韩中文字幕在线 | 亚洲视频自拍 | 国产免费色 | 国产免费拔擦拔擦8x高清在线人 | 欧美理论片在线观看 |