我的MySQL有什么问题创建表代码?

时间:2012-08-01 13:28:45

标签: mysql web phpmyadmin

为什么我从此代码

中收到此错误
CREATE TABLE `a9311211_AppBook`.`Requests` 
(
   `Name` VARCHAR( 15 ) UNSIGNED CHARACTER SET hp8 COLLATE hp8_bin NOT NULL ,
   `Category` BLOB UNSIGNED NOT NULL ,
   `Dificulty` FLOAT( 2 ) UNSIGNED NOT NULL ,
   `Discription` LONGTEXT UNSIGNED CHARACTER SET hp8 COLLATE hp8_bin NOT NULL 
) ENGINE = MYISAM CHARACTER SET hp8 COLLATE hp8_bin 
  

MySQL说:
   #1064 - 您的SQL语法有错误;查看与您的MySQL服务器版本对应的手册,以便在'UNSIGNED CHARACTER SET附近使用正确的语法hp8 COLLATE hp8_bin NOT NULL,Category BLOB UNSIGNED NO'在第1行

2 个答案:

答案 0 :(得分:1)

删除unsigned

 CREATE TABLE `a9311211_AppBook`.`Requests` (
    `Name` VARCHAR( 15 ) CHARACTER SET hp8 COLLATE hp8_bin NOT NULL ,
    `Catagory` BLOB NOT NULL ,
    `Dificulty` FLOAT( 2 ) UNSIGNED NOT NULL ,
    `Discription` LONGTEXT CHARACTER SET hp8 COLLATE hp8_bin NOT NULL 
) ENGINE = MYISAM CHARACTER SET hp8 COLLATE hp8_bin 

只有数字类型可以是unsigned

答案 1 :(得分:0)

它应该是:

`Catagory` BLOB NOT NULL

BLOB不能是正面也不是否定(因为它不是数字)。