用于创建表的mysql查询中的ERROR 1064

时间:2014-05-24 05:39:42

标签: php mysql sql

在此代码中获取1064 mysql错误....

CREATE TABLE User(
    user_id int(10), 
    first_name varchar2(30) NOT NULL, 
    last_name varchar2(30) NOT NULL, 
    user_name varchar2(20), 
    email_id varchar2(50), 
    password varchar2(20) NOT NULL, 
    contact_no varchar2(15), 
    highest_degree varchar2(30) NOT NULL, 
    photo longblob, 
    STATE varchar2(25), 
    score int NOT NULL, 
    institute_name varchar2(50), 
    PRIMARY KEY(user_id), 
    UNIQUE (user_name), 
    UNIQUE(email_id)) ENGINE=InnoDB;

无法弄清楚如何消除它..任何人都可以帮忙吗?

1 个答案:

答案 0 :(得分:1)

mysql中没有varchar2 使用 varchar

这有效

create table User(
  user_id int(10),
  first_name varchar(30) NOT NULL,
  last_name varchar(30) NOT NULL,
  user_name varchar(20),
  email_id varchar(50),
  password varchar(20) NOT NULL,
  contact_no varchar(15),
  highest_degree varchar(30) NOT NULL,
  photo longblob,
  state varchar(25),
  score int NOT NULL,
  institute_name varchar(50),
  PRIMARY KEY(user_id),
  UNIQUE (user_name),
  UNIQUE(email_id)
) ENGINE=InnoDB;