使用sqlyog创建数据库的错误

1、错误代码: 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 'CREATE TABLE grade(
gradeID INT(4) UNSIGNED NOT NULL PRIMARY KEY AUTO_INCR' at line 2

代码如下:

USE Myschool;
DROP TABLE IF EXISTS grade
CREATE TABLE grade(
      gradeID INT(4) UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT COMMENT '年级编号',
      gradeName VARCHAR(50) NOT NULL COMMENT '年级名称'
      )COMMENT="年级表";

仔细看就会发现,drop table if exists grade这一行,没有加  ';'

posted @ 2018-04-12 14:46  YTester  阅读(718)  评论(0编辑  收藏  举报