error in mysql syntax

前端 未结 3 1652
傲寒
傲寒 2021-01-25 14:56

while executing the following query, i get an error that there\'s an error in the syntax near line 9. since i\'m using mysql workbench, i can\'t really figure out what could be

3条回答
  •  生来不讨喜
    2021-01-25 15:37

    The three obvious errors are a lack of fields in your INDEX and FOREIGN KEY definitions. You have to specify one or more fields for each, otherwise it's a syntax error.

    INDEX `vAuthorID` () ,  <--need a field here in the ()'s
    CONSTRAINT `vAuthorID`
        FOREIGN KEY ()  <---another field here in the ()'s
        REFERENCES `proquotes`.`author_info` ()  <--and yet another field here in the ()'s
    

    You're also not specifying which database engine to use, which generally means MySQL will use MyISAM, so all of your foreign key specifications will be silently dropped.

提交回复
热议问题