Hibernate 建表-Error executing DDL via JDBC Statement

毕设错误3

今天在写毕设的时候,偶然出现了这个错误,如下:

1
2
Error executing DDL  via JDBC Statement

遇见错误后,我做了这些事:

  1. 检查MySQL版本。
  2. 打开MySQL的Line Command,将出错误的MySQL复制进MySQL Line Command,找到出错原因对应的错误码。
  3. 上网查询对应的出错信息,比对最初的错误信息。

最终我找到的了错误信息,那就是:
违规使用了MySQL的保留字。

MySQL的保留字共有这些,你可以查看一下:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
ADD	ALL	ALTER
ANALYZE AND AS
ASC AUTO_INCREMENT BDB
BEFORE BERKELEYDB BETWEEN
BIGINT BINARY BLOB
BOTH BTREE BY
CASCADE CASE CHANGE
CHAR CHARACTER CHECK
COLLATE COLUMN COLUMNS
CONSTRAINT CREATE CROSS
CURRENT_DATE CURRENT_TIME CURRENT_TIMESTAMP
DATABASE DATABASES DAY_HOUR
DAY_MINUTE DAY_SECOND DEC
DECIMAL DEFAULT DELAYED
DELETE DESC DESCRIBE
DISTINCT DISTINCTROW DIV
DOUBLE DROP ELSE
ENCLOSED ERRORS ESCAPED
EXISTS EXPLAIN FALSE
FIELDS FLOAT FOR
FORCE FOREIGN FROM
FULLTEXT FUNCTION GRANT
GROUP HASH HAVING
HIGH_PRIORITY HOUR_MINUTE HOUR_SECOND
IF IGNORE IN
INDEX INFILE INNER
INNODB INSERT INT
INTEGER INTERVAL INTO
IS JOIN KEY
KEYS KILL LEADING
LEFT LIKE LIMIT
LINES LOAD LOCALTIME
LOCALTIMESTAMP LOCK LONG
LONGBLOB LONGTEXT LOW_PRIORITY
MASTER_SERVER_ID MATCH MEDIUMBLOB
MEDIUMINT MEDIUMTEXT MIDDLEINT
MINUTE_SECOND MOD MRG_MYISAM
NATURAL NOT NULL
NUMERIC ON OPTIMIZE
OPTION OPTIONALLY OR
ORDER OUTER OUTFILE
PRECISION PRIMARY PRIVILEGES
PROCEDURE PURGE READ
REAL REFERENCES REGEXP
RENAME REPLACE REQUIRE
RESTRICT RETURNS REVOKE
RIGHT RLIKE RTREE
SELECT SET SHOW
SMALLINT SOME SONAME
SPATIAL SQL_BIG_RESULT SQL_CALC_FOUND_ROWS
SQL_SMALL_RESULT SSL STARTING
STRAIGHT_JOIN STRIPED TABLE
TABLES TERMINATED THEN
TINYBLOB TINYINT TINYTEXT
TO TRAILING TRUE
TYPES UNION UNIQUE
UNLOCK UNSIGNED UPDATE
USAGE USE USER_RESOURCES
USING VALUES VARBINARY
VARCHAR VARCHARACTER VARYING
WARNINGS WHEN WHERE
WITH WRITE XOR
YEAR_MONTH ZEROFILL

再出错的时候,你可以用来比对一下,就知道哪里出错了!