mysql hibernate方言问题
配置文件:<propertyname="hibernate.dialect">org.hibernate.dialect.MySQL5InnoDBDialect</pro...
配置文件:
<property name="hibernate.dialect">org.hibernate.dialect.MySQL5InnoDBDialect</property>
<property name="hibernate.connection.url">jdbc:mysql://localhost:3306/push</property>
<property name="hibernate.connection.username">root</property>
<property name="hibernate.connection.password">admin237</property>
<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
程序在本地机器上跑没有问题,一切正常,布署到服务器上以后报错(服务器程序与mysql在一起,所以localhost的url没有错),错误如下:
用户登陆时打印sql语句:
Hibernate: select admin0_.AdminId as AdminId0_, admin0_.AdminName as AdminName0_, admin0_.AdminMail as AdminMail0_, admin0_.AdminPassword as AdminPas4_0_, admin0_.AdminRealname as AdminRea5_0_, admin0_.AdminNickname as AdminNic6_0_, admin0_.AdminPhone as AdminPhone0_, admin0_.AdminDepartment as AdminDep8_0_, admin0_.AdminJob as AdminJob0_, admin0_.AdminRoleId as AdminRo10_0_, admin0_.AdminRoleName as AdminRo11_0_, admin0_.AdminState as AdminState0_, admin0_.DelFlag as DelFlag0_, admin0_.AddTime as AddTime0_ from Admin admin0_ where admin0_.AdminName=? and admin0_.AdminPassword=?
错误信息:
org.hibernate.exception.SQLGrammarException: could not execute query
Caused by: com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: Table 'push.Admin' doesn't exist
求解答!以为是方言问题,但是过换mysql5以上的方言支持以后,错误依旧。 展开
<property name="hibernate.dialect">org.hibernate.dialect.MySQL5InnoDBDialect</property>
<property name="hibernate.connection.url">jdbc:mysql://localhost:3306/push</property>
<property name="hibernate.connection.username">root</property>
<property name="hibernate.connection.password">admin237</property>
<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
程序在本地机器上跑没有问题,一切正常,布署到服务器上以后报错(服务器程序与mysql在一起,所以localhost的url没有错),错误如下:
用户登陆时打印sql语句:
Hibernate: select admin0_.AdminId as AdminId0_, admin0_.AdminName as AdminName0_, admin0_.AdminMail as AdminMail0_, admin0_.AdminPassword as AdminPas4_0_, admin0_.AdminRealname as AdminRea5_0_, admin0_.AdminNickname as AdminNic6_0_, admin0_.AdminPhone as AdminPhone0_, admin0_.AdminDepartment as AdminDep8_0_, admin0_.AdminJob as AdminJob0_, admin0_.AdminRoleId as AdminRo10_0_, admin0_.AdminRoleName as AdminRo11_0_, admin0_.AdminState as AdminState0_, admin0_.DelFlag as DelFlag0_, admin0_.AddTime as AddTime0_ from Admin admin0_ where admin0_.AdminName=? and admin0_.AdminPassword=?
错误信息:
org.hibernate.exception.SQLGrammarException: could not execute query
Caused by: com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: Table 'push.Admin' doesn't exist
求解答!以为是方言问题,但是过换mysql5以上的方言支持以后,错误依旧。 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询