日期:2014-05-16  浏览次数:20796 次

求助:Mysql 错误码1064
在mysql workbench用脚本文件创建数据库与表,出现:
Error Code: 1064. 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 'CREATE table Users(Id int identity(10000,1) not null'


脚本代码如下:
create database myqq;
use myqq;

CREATE table Users(
  Id int IDENTITY(10000,1) not null,
  LoginPwd varchar(50) not null,
  FriendshipPolicyId int not null,
  NickName varchar(50) not null,
  FaceId int not null,
  Sex varchar(50) not null,
  Age int not null,
  Name varchar(50) not null,
  StarId int not null,
  BloodTypeId int not null
);

在 IDENTITY(10000,1)处一直出现红色波浪线显示语法错误,本人Mysql小白,想请教各位语法方面出了什么问题?

谢谢各位了!!!

------解决方案--------------------
MYSQL 的语法中没有 IDENTITY(10000,1) 楼主需要查看一下MYSQL手册语法说明。


CREATE table Users(
Id int auto_increment primary key,
LoginPwd varchar(50) not null,
FriendshipPolicyId int not null,
NickName varchar(50) not null,
FaceId int not null,
Sex varchar(50) not null,
Age int not null,
Name varchar(50) not null,
StarId int not null,
BloodTypeId int not null
) AUTO_INCREMENT =10000;

------解决方案--------------------
IDENTITY是sqlserver的语法
mysql用aut_increment(1,1)