English 中文(简体)
我的面纱产生文字,错误给我造成麻烦
原标题:mysql create script, error giving me trouble

使用我的SQL版本5.0.51a-24+lenny4, 以下文字有什么错误? 我保留以下错误:

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  mjla_creat.sql  at line 1

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 ;


-- -----------------------------------------------------
-- Table `mjla_db`.`ClassTable`
-- -----------------------------------------------------
CREATE  TABLE IF NOT EXISTS `mjla_db`.`ClassTable` (
  `classId` VARCHAR(20) NOT NULL COMMENT  This columns is used to store the class identifier.  ,
  `className` VARCHAR(10) NOT NULL COMMENT  Holds the name of the class. for example.  ,
  `classSection` VARCHAR(5) NOT NULL COMMENT  Holds the section label. Used to designate which section the class is.  ,
  `classSemester` VARCHAR(2) NOT NULL COMMENT  This is used to designate which semester. This is given two character positions incase a school needed to determine which semester within the semester.  ,
  `classYear` VARCHAR(4) NOT NULL COMMENT  This is for the year of the class.  ,
  `teacherId` VARCHAR(20) NOT NULL ,
  PRIMARY KEY (`classId`) ,
  UNIQUE INDEX `classId_UNIQUE` (`classId` ASC) )
ENGINE = InnoDB;


-- -----------------------------------------------------
-- Table `mjla_db`.`TeacherTable`
-- -----------------------------------------------------
CREATE  TABLE IF NOT EXISTS `mjla_db`.`TeacherTable` (
  `teacherId` VARCHAR(20) NOT NULL COMMENT  This is the teacher id. This table will have to be pre-populated by the administrator with teacher id s and their passwords.  ,
  `teacherPassword` VARCHAR(32) NOT NULL COMMENT  Stores the password as md5.  ,
  PRIMARY KEY (`teacherId`) ,
  UNIQUE INDEX `teacherId_UNIQUE` (`teacherId` ASC) )
ENGINE = InnoDB;


-- -----------------------------------------------------
-- Table `mjla_db`.`QuizTable`
-- -----------------------------------------------------
CREATE  TABLE IF NOT EXISTS `mjla_db`.`QuizTable` (
  `classId` VARCHAR(20) NOT NULL COMMENT  FK related to the ClassTable. This way each Class in the ClassTable is associated with its quiz in the QuizTable.  ,
  `quizId` INT NOT NULL AUTO_INCREMENT COMMENT  This is the quiz number associated with the quiz.  ,
  `quizObject` BLOB NOT NULL COMMENT  This is the actual quiz object.  ,
  `quizEnabled` TINYINT(1)  NOT NULL ,
  PRIMARY KEY (`classId`) )
ENGINE = InnoDB;


-- -----------------------------------------------------
-- Table `mjla_db`.`StudentTable`
-- -----------------------------------------------------
CREATE  TABLE IF NOT EXISTS `mjla_db`.`StudentTable` (
  `studentId` VARCHAR(20) NOT NULL ,
  `lastName` VARCHAR(45) NOT NULL ,
  `firstName` VARCHAR(45) NOT NULL ,
  `studentPassword` VARCHAR(32) NOT NULL ,
  PRIMARY KEY (`studentId`) )
ENGINE = InnoDB;


-- -----------------------------------------------------
-- Table `mjla_db`.`StudentRecordTable`
-- -----------------------------------------------------
CREATE  TABLE IF NOT EXISTS `mjla_db`.`StudentRecordTable` (
  `classId` VARCHAR(20) NOT NULL ,
  `studentId` VARCHAR(20) NOT NULL ,
  `quizGrade` TINYINT NULL ,
  `quizId` INT NOT NULL AUTO_INCREMENT ,
  PRIMARY KEY (`classId`) )
ENGINE = InnoDB;



SET SQL_MODE=@OLD_SQL_MODE;
SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;

Thanks!

最佳回答

页: 1

这句话没有出现在你所展示的卡片里,因此这个错误不在你的卡片里。 这可能是你重新使用该文字的指令中的错误。

您可以迅速援引(可能还需要其他选择才能与数据库连接):

$ mysql mjla < mjla_creat.sql 

或者你可以援引MySQL监测器:

mysql> . mjla_creat.sql

mysql> source mjla_creat.sql
问题回答

暂无回答




相关问题
SQL SubQuery getting particular column

I noticed that there were some threads with similar questions, and I did look through them but did not really get a convincing answer. Here s my question: The subquery below returns a Table with 3 ...

please can anyone check this while loop and if condition

<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...

php return a specific row from query

Is it possible in php to return a specific row of data from a mysql query? None of the fetch statements that I ve found return a 2 dimensional array to access specific rows. I want to be able to ...

Character Encodings in PHP and MySQL

Our website was developed with a meta tag set to... <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> This works fine for M-dashes and special quotes, etc. However, I ...

Pagination Strategies for Complex (slow) Datasets

What are some of the strategies being used for pagination of data sets that involve complex queries? count(*) takes ~1.5 sec so we don t want to hit the DB for every page view. Currently there are ~...

Averaging a total in mySQL

My table looks like person_id | car_id | miles ------------------------------ 1 | 1 | 100 1 | 2 | 200 2 | 3 | 1000 2 | 4 | 500 I need to ...

热门标签