这是我的数据库文件
DROP DATABASE IF EXISTS mystock
-- 建立数据库
CREATE DATABASE IF NOT EXISTS betatown DEFAULT CHARSET utf8 COLLATE utf8_general_ci
alter database mystock character set utf8
set character_set_client=utf8
set character_set_connection=utf8
set character_set_database=utf8
set character_set_results=utf8
set character_set_server=utf8
/*
MySQL Data Transfer
Source Host: localhost
Source Database: mystock
Target Host: localhost
Target Database: mystock
Date: 2011-03-07 02:53:56
*/
SET FOREIGN_KEY_CHECKS=0
-- ----------------------------
-- Table structure for bsd
-- ----------------------------
DROP TABLE IF EXISTS `bsd`
CREATE TABLE `bsd` (
`djid` varchar(14) NOT NULL,
`riqi` date NOT NULL,
`userid` int(11) default NULL,
`username` varchar(20) default NULL,
`bz` varchar(200) default NULL COMMENT '备注',
PRIMARY KEY (`djid`),
KEY `userid` (`userid`),
CONSTRAINT `bsd_ibfk_2` FOREIGN KEY (`userid`) REFERENCES `users` (`userid`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='报损单'
-- ----------------------------
-- Table structure for bsdsp
-- ----------------------------
DROP TABLE IF EXISTS `bsdsp`
CREATE TABLE `bsdsp` (
`id` int(11) NOT NULL auto_increment,
`djid` varchar(14) NOT NULL,
`spid` varchar(10) NOT NULL COMMENT '商品id',
`spname` varchar(20) default NULL COMMENT '商品名称',
`spdw` varchar(20) default NULL COMMENT '商品单位',
`spxinghao` varchar(20) default NULL COMMENT '规格型号',
`dj` double default NULL COMMENT '单价',
`sl` int(11) default NULL COMMENT '数量',
`zj` double default NULL COMMENT '总价',
PRIMARY KEY (`id`),
KEY `F_Bsdsp_Bsd` (`djid`),
KEY `spid` (`spid`),
CONSTRAINT `bsdsp_ibfk_1` FOREIGN KEY (`spid`) REFERENCES `spxx` (`spid`),
CONSTRAINT `F_Bsdsp_Bsd` FOREIGN KEY (`djid`) REFERENCES `bsd` (`djid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='报损单商品'
-- ----------------------------
-- Table structure for byd
-- ----------------------------
DROP TABLE IF EXISTS `byd`
CREATE TABLE `byd` (
`djid` varchar(14) NOT NULL,
`riqi` date NOT NULL,
`userid` int(11) default NULL,
`username` varchar(20) default NULL,
`bz` varchar(200) default NULL COMMENT '备注',
PRIMARY KEY (`djid`),
KEY `userid` (`userid`),
CONSTRAINT `byd_ibfk_2` FOREIGN KEY (`userid`) REFERENCES `users` (`userid`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='报溢单'
-- ----------------------------
-- Table structure for bydsp
-- ----------------------------
DROP TABLE IF EXISTS `bydsp`
CREATE TABLE `bydsp` (
`id` int(11) NOT NULL auto_increment,
`djid` varchar(14) NOT NULL,
`spid` varchar(10) NOT NULL COMMENT '商品id',
`spname` varchar(20) default NULL COMMENT '商品名称',
`spdw` varchar(20) default NULL COMMENT '商品单位',
`spxinghao` varchar(20) default NULL COMMENT '规格型号',
`dj` double default NULL COMMENT '单价',
`sl` int(11) default NULL COMMENT '数量',
`zj` double default NULL COMMENT '总价',
PRIMARY KEY (`id`),
KEY `FK_Bydsp_Byd` (`djid`),
KEY `spid` (`spid`),
CONSTRAINT `bydsp_ibfk_1` FOREIGN KEY (`spid`) REFERENCES `spxx` (`spid`),
CONSTRAINT `FK_Bydsp_Byd` FOREIGN KEY (`djid`) REFERENCES `byd` (`djid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='报溢单商品'
-- ----------------------------
-- Table structure for ckd
-- ----------------------------
DROP TABLE IF EXISTS `ckd`
CREATE TABLE `ckd` (
`djid` varchar(14) NOT NULL,
`khid` int(11) default NULL COMMENT '供应商id',
`khname` varchar(50) default NULL,
`riqi` date NOT NULL,
`yfje` double default NULL,
`sfje` double default NULL,
`cbje` double default NULL,
`jystate` varchar(2) default NULL,
`userid` int(11) default NULL,
`username` varchar(20) default NULL,
`bz` varchar(200) default NULL COMMENT '备注',
PRIMARY KEY (`djid`),
KEY `FK_Ckd_Kh` (`khid`),
KEY `FK_Ckd_Users` (`userid`),
CONSTRAINT `FK_Ckd_Kh` FOREIGN KEY (`khid`) REFERENCES `kh` (`khid`) ON DELETE SET NULL,
CONSTRAINT `FK_Ckd_Users` FOREIGN KEY (`userid`) REFERENCES `users` (`userid`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='销售出库'
-- ----------------------------
-- Table structure for ckdsp
-- ----------------------------
DROP TABLE IF EXISTS `ckdsp`
CREATE TABLE `ckdsp` (
`id` int(11) NOT NULL auto_increment,
`djid` varchar(14) NOT NULL,
`spid` varchar(10) NOT NULL COMMENT '商品id',
`spname` varchar(20) default NULL COMMENT '商品名称',
`spdw` varchar(20) default NULL COMMENT '商品单位',
`spxinghao` varchar(20) default NULL COMMENT '规格型号',
`lbid` int(11) default NULL,
`lbname` varchar(20) default NULL,
`dj` double default NULL COMMENT '单价',
`sl` int(11) default NULL COMMENT '数量',
`zj` double default NULL COMMENT '总价',
PRIMARY KEY (`id`),
KEY `FK_Ckdsp_Ckd` (`djid`),
KEY `spid` (`spid`),
CONSTRAINT `ckdsp_ibfk_1` FOREIGN KEY (`spid`) REFERENCES `spxx` (`spid`),
CONSTRAINT `FK_Ckdsp_Ckd` FOREIGN KEY (`djid`) REFERENCES `ckd` (`djid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='销售单商品'
-- ----------------------------
-- Table structure for gys
-- ----------------------------
DROP TABLE IF EXISTS `gys`
CREATE TABLE `gys` (
`gysid` int(11) NOT NULL auto_increment,
`name` varchar(50) NOT NULL,
`lxren` varchar(30) default NULL COMMENT '联系人',
`lxtel` varchar(30) default NULL COMMENT '联系电话',
`address` varchar(50) default NULL COMMENT '地址',
`bz` varchar(200) default NULL COMMENT '备注',
PRIMARY KEY (`gysid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='供应商'
-- ----------------------------
-- Table structure for jhd
-- ----------------------------
DROP TABLE IF EXISTS `jhd`
CREATE TABLE `jhd` (
`djid` varchar(14) NOT NU
mysql 1064错误 有三个错误 但是不知道在哪里 希望大神指教 在下感激不尽 谢谢!!!
这篇博客中,作者遇到了在执行MySQL数据库脚本时遇到1064错误,脚本涉及数据库创建、表结构定义、触发器等内容。作者希望得到帮助定位并解决三个错误。博客提供了完整的数据库脚本,包括数据导入、表结构和触发器的创建,读者可以借此了解MySQL数据库操作。
摘要由CSDN通过智能技术生成