Recently a project with SSH, I started from SVN on the Checkout project (configured hibernate.hbm2ddl.auto=update), the result table is not automatically generated (the table does not exist), and then look at the console, the console prompts to create the table failed, To take the creation statement out is:
HHH000388:Unsuccessful:create table T_user (user_id bigint not NULL auto_increment, Card_number varchar (+), Card_type V Archar (), company_name varchar (+), email varchar (+), gender varchar (+) NOT NULL, identity varchar (+), job_name VA Rchar, Mobile varchar (+) NOT NULL, password varchar (+) NOT NULL, Real_name varchar (+) NOT NULL, PRIMARY key (user _id)) Type=innodb
2014-11-10 10:27:10,749 Error (org.hibernate.tool.hbm2ddl.schemaupdate:237)-You have a error in your SQL syntax; Check the manual, corresponds to your MySQL server version for the right syntax ' Type=innodb ' ? At line 14
2014-11-10 10:27:10,756 ERROR (org.hibernate.tool.hbm2ddl.schemaupdate:236)-HHH000388:Unsuccessful:create table T_ Word (word_id bigint not NULL auto_increment, content longtext not NULL, Create_date datetime, Modify_date datetime, title varchar (+) NOT NULL, author_id bigint, primary key (word_id)) Type=innodb
2014-11-10 10:27:10,763 Error (org.hibernate.tool.hbm2ddl.schemaupdate:237)-You have a error in your SQL syntax; Check the manual-corresponds to your MySQL server version for the right syntax-use-near ' type=innodb ' on line 9
2014-11-10 10:27:10,767 ERROR (org.hibernate.tool.hbm2ddl.schemaupdate:236)-HHH000388:Unsuccessful:create table T_ Wordreply (reply_id bigint not NULL auto_increment, content longtext not NULL, Reply_date datetime, replier_id bigint, wor d_id bigint, primary key (reply_id)) Type=innodb
you can see from the back . Type=innodb, after searching the internet, it turns out that Type=innodb was used before 5.0, and my database is 5.5.
This time we need to change the dialect of MySQL in Hibernate,
Original: Hibernate.dialect=org.hibernate.dialect.mysqlinnodbdialect
Change to: Hibernate.dialect=org.hibernate.dialect.mysql5innodbdialect
HIBERNATE4 connection MySQL auto create table error