求助……powerdesigner 导出 sql 在 navicat for mysql运行错误
下面是生成的sql语句:
drop table if exists Privilege;
drop table if exists administrator;
drop table if exists book;
drop table if exists evaluation;
drop table if exists favorite;
drop table if exists notice;
drop table if exists orderform;
drop table if exists shoppingcar;
drop table if exists user;
/*==============================================================*/
/* Table: Privilege */
/*==============================================================*/
create table Privilege
(
userid int not null,
privilege int(3),
primary key (userid)
)
type = BDB;
alter table Privilege comment '权限';
create table administrator
(
administratorid int not null,
name varchar(16),
password varchar(20),
primary key (administratorid)
)
type = BDB;
alter table administrator comment '管理员';
create table book
(
bookid integer not null,
name varchar(20) not null,
author varchar(16) not null,
press varchar(20) not null comment '出版社',
language varchar(8) comment '语言',
bookprice float not null,
type int not null,
discount float(1) comment '折扣',
storage int not null comment '库存量',
salenum int not null comment '销量',
introduction text comment '简介',
primary key (bookid)
)
type = BDB;
alter table book comment '书';
create table evaluation
(
bookid integer not null,
time datetime,
text text,
starnum int(5),
userid int,
primary key (bookid)
)
type = BDB;
alter table evaluation comment '评价';
create table favorite
(
userid int not null,
bookid integer,
primary key (userid)
)
type = BDB;
alter table favorite comment '收藏夹';
create table notice
(
administratorid int,
id int not null,
time datetime,
text text,
who varchar(16),
primary key (id)
)
type = BDB;
alter table notice comment '公告';
create table orderform
(
ordernum varchar(10) not null comment '订单号',
starttime datetime not null comment '开始时间',
stoptime datetime not null comment '结束时间',
paytime datetime not null comment '支付时间',
ifpay boolean not null comment '是否已支付',
shouldpay float comment '应付',
favorable float comment '优惠',
payprice float not null comment '实际支付',
userid int comment '购买人',
bookid integer,
address varchar(50) comment '地址',
postcode varchar(6) comment '邮编',
transportcost float comment '运费',
totalepay float comment '总费用',
primary key (ordernum)
)
type = BDB;
alter table orderform comment '订单';
create table shoppingcar
(
userid int not null,
bookid integer,
primary key (userid)
)
type = BDB;
alter table shoppingcar comment '购物车';
create table user
(
userid int not null,
name varchar(20) not null,
password varchar(16) not null,
birthday date,
易做图 int(2),
grade int(13) not null,
registetime date not null,
lastlogintime datetime,
ip varchar(15),
email varchar(50),
primary key (userid)
)
type = BDB;
alter table user comment '会员';
alter table evaluation add constraint "FK_evaluation_bookid--book_bookid" foreign key (bookid)
references book (bookid) on delete restrict on update restrict;
alter table evaluation add constraint "FK_evaluation_useid--user_userid" foreign key (userid)
references user (userid) on delete restrict on update restrict;
alter table favorite add constraint "FK_favorite_bookid--book_bookid" foreign key (bookid)
references book (bookid) on delete restrict on update restrict;
alter table favorite add constraint "FK_favorite_userid--user_userid" foreign key (userid)
references user (userid) on delete restrict on update restrict;
alter table notice add constraint "FK_notice_administrator--administrator_administratorid" foreign key (administratorid)
references administrator (administratorid) on delete restrict on update restrict;
alter table orderform add constraint "FK_order_bookid--book_bookid" foreign key (bookid)
references book (bookid) on delete restrict on update restrict;
alter table orderform add constraint "FK_order_userid--user_userid" foreign key (userid)
references user (userid) on delete restrict on update restrict;
alter table shoppingcar add constraint "FK_shopping_book--book_bookid" foreign key (bookid)
references book (bookid) on delete restrict on update restrict;
alter table shoppingcar add constraint "FK_shopping_userid--user_userid" foreign key (userid)
references user (userid) on delete restrict on update restrict;
在navicat for mysql里运行错误:
[Err] 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 'type = BDB;
alter table Privilege comment '权限';
/*====================' at line 10
[Err] /*==============================================================*/
/* DBMS name: MySQL 5.0 */
/* Created on: 2013/3/13 星期三 20:14:40 */
/*==============================================================*/
drop table if exists Privilege;
drop table if exists administrator;
drop table if exists book;
drop table if exists evaluation;
drop table if exists favorite;
drop table if exists notice;
drop table if exists orderform;
drop table if exists shoppingcar;
drop table if exists user;
/*==============================================================*/
/* Table: Privilege */
/*==============================================================*/
create table Privilege
(
userid int not null,
privilege int(3),
primary key (userid)
)
type = BDB;
alter table Privilege comment '权限';
/*==============================================================*/
/* Table: administrator */
/*==============================================================*/
create table administrator
(
administratorid int not null,
name varchar(16),
password varchar(20),
primary key (administratorid)
)
type = BDB;
alter table administrator comment '管理员';
/*==============================================================*/
/* Table: book */
/*==============================================================*/
create table book
(
bookid integer not null,
name varchar(20) not null,
author varchar(16) not null,
press varchar(20) not null comment '出版社',
language varchar(8) comment '语言',
bookprice float not null,
type int not null,
discount float(1) comment '折扣',
storage int not null comment '库存量',
salenum int not null comment '销量',
introduction text comment '简介',
primary key (bookid)
)
type = BDB;
alter table book comment '书';
/*==============================================================*/
/* Table: evaluation */
/*==============================================================*/
create table evaluation
(
bookid integer not null,
time datetime,
text text,
starnum int(5),
userid int,
primary key (bookid)
)
type = BDB;
alter table evaluation comment '评价';
/*==============================================================*/
/* Table: favorite */
/*==============================================================*/
create table favorite
(
userid int not null,
bookid integer,
primary key (userid)
)
type = BDB;
alter table favorite comment '收藏夹';
/*==============================================================*/
/* Table: notice */
/*==============================================================*/
create table notice
(
administratorid int,
id int not null,
time datetime,
text text,
who varchar(16),
primary key (id)
)
type = BDB;
alter table notice comment '公告';
/*==============================================================*/
/* Table: orderform */
/*==============================================================*/
create table orderform
(
ordernum varchar(10) not null comment '订单号',
starttime datetime not null comment '开始时间',
stoptime datetime not null comment '结束时间',
paytime datetime not null comment '支付时间',
ifpay boolean
[Msg] Finished - Unsuccessfully
--------------------------------------------------
MySQL版本:5.5
求助啊 sql mysql --------------------编程问答-------------------- 数据库引擎不同
你需要 将type=BDB 改成你当前数据库引擎
或者修改当前数据库引擎为 Berkley DB (BDB)
见
http://blog.csdn.net/waterborn/article/details/550321 --------------------编程问答--------------------
请问 怎么修改数据库的引擎呢
补充:Java , Web 开发