首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > Mysql >

为什么小弟我的创建数据库语句有错

2012-11-05 
为什么我的创建数据库语句有错?SQL codecreate database registext (userid smallint unsigned not null a

为什么我的创建数据库语句有错?

SQL code
create database registext (userid smallint unsigned not null auto_increment,username varchar(10) not null unique,userpassword varchar(20) not null,email varchar(20) not null,primary key(userid));


显示错误:
ERROR 1064 (42000): 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 '(
userid smallint unsigned not null auto_increment,
username varchar(10) not nul' at line 1

[解决办法]
应该是create table吧
[解决办法]
create table registext (
userid smallint unsigned not null auto_increment,
username varchar(10) not null unique,
userpassword varchar(20) not null,
email varchar(20) not null,
primary key(userid)
);
[解决办法]
你是创建表吧
create table registext (
userid smallint unsigned not null auto_increment,
username varchar(10) not null unique,
userpassword varchar(20) not null,
email varchar(20) not null,
primary key(userid)
);

创建数据库
create database registext ;


[解决办法]
create table registext(...

热点排行