0

我已经从 MySQL WorkBench 生成了这个脚本,但是当我尝试在我的 MySQL 服务器中运行它时,我收到以下错误:'17:28:11 DROP SCHEMA IF EXISTS MYA_Database_SchemaError Code: 1044. Access denied for user ''@'localhost ' 到数据库 'MYA_Database_Schema' 0.000 秒'

前 2 个表的创建没有任何问题,但是当涉及 B​​MCDetail 时,我不断收到错误。感谢任何帮助,因为我正在为一个新项目设计数据库,并且我需要尽快在服务器上获取此数据库模式。即使您指出我正确的方向,任何帮助都会很棒。

操作系统 Ubuntu Linux 12.04 MySQL 版本 5.5.22

我试图在我通过 phpmyadmin 安装的本地 xampp 服务器上复制它,但仍然存在类似问题。

'SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL,ALLOW_INVALID_DATES';

DROP SCHEMA IF EXISTS `MYA_Database_Schema` ;
CREATE SCHEMA IF NOT EXISTS `MYA_Database_Schema` DEFAULT CHARACTER SET utf8 COLLATE     utf8_general_ci ;
SHOW WARNINGS;
USE `MYA_Database_Schema` ;

- 桌子BMCSupervisor


DROP TABLE IF EXISTS `BMCSupervisor` ;

SHOW WARNINGS;
CREATE  TABLE IF NOT EXISTS `BMCSupervisor` (
  `idBMCSupervisor` INT NOT NULL AUTO_INCREMENT ,
  `SupervisorName` VARCHAR(30) NULL ,
  `EmployeeCode` INT NULL ,
   `PhoneNumber` INT NULL ,
  `EmailID` VARCHAR(100) NULL ,
  `BMCSupervisorID` VARCHAR(5) NOT NULL ,
  PRIMARY KEY (`idBMCSupervisor`, `BMCSupervisorID`) )
ENGINE = InnoDB;

SHOW WARNINGS;

- 桌子BMCSupplierEnrolManager


DROP TABLE IF EXISTS `BMCSupplierEnrolManager` ;

SHOW WARNINGS;
CREATE  TABLE IF NOT EXISTS `BMCSupplierEnrolManager` (
  `idBMCSupplierEnrolManager` INT NOT NULL AUTO_INCREMENT ,
  `Name` VARCHAR(25) NULL ,
  `EmployeeCode` INT NULL ,
  `PhoneNumber` INT NULL ,
  `EmailID` VARCHAR(100) NULL ,
  `SupplierEnrolManagerID` INT NOT NULL ,
  PRIMARY KEY (`idBMCSupplierEnrolManager`, `SupplierEnrolManagerID`) )
ENGINE = InnoDB;

 SHOW WARNINGS;

- 桌子BMCDetail


DROP TABLE IF EXISTS `BMCDetail` ;

SHOW WARNINGS;
CREATE  TABLE IF NOT EXISTS `BMCDetail` (
  `idBMCDetail` INT NOT NULL AUTO_INCREMENT ,
  `BMCCode` VARCHAR(5) NOT NULL ,
  `BMCName` VARCHAR(10) NULL ,
  `State` VARCHAR(25) NOT NULL ,
  `District` VARCHAR(20) NOT NULL ,
  `Block` VARCHAR(15) NULL ,
  `Taluk` VARCHAR(15) NULL ,
  `Village` VARCHAR(20) NULL ,
  `BMCCapacity` DECIMAL(10,2) NULL ,
  `DateOfCommissioning` DATE NULL ,
  `SupervisorID` VARCHAR(5) NOT NULL ,
  `SupplierEnrolManagerID` INT NOT NULL ,
  PRIMARY KEY (`idBMCDetail`, `BMCCode`, `State`, `District`) ,
  CONSTRAINT `SupervisorID`
    FOREIGN KEY (`SupervisorID` )
    REFERENCES `BMCSupervisor` (`BMCSupervisorID` )
    ON DELETE NO ACTION
    ON UPDATE NO ACTION,
  CONSTRAINT `SupplierEnrolManagerID`
    FOREIGN KEY (`SupplierEnrolManagerID` )
    REFERENCES `BMCSupplierEnrolManager` (`SupplierEnrolManagerID` )
    ON DELETE NO ACTION
    ON UPDATE NO ACTION)
ENGINE = InnoDB;'
4

0 回答 0