0

我遇到了休眠问题,想在用户名末尾添加@.myisp.whatever.net。即使我尝试自己使用@mydatabase.com 对其进行限定,它仍然会附加到另一个@ 我如何阻止它这样做?

休眠配置:

<hibernate-configuration>
 <session-factory name="">
  <property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
  <property name="hibernate.connection.password">password</property>
  <property name="hibernate.connection.url">jdbc:mysql://mydatabase.com:3306/database</property>
  <property name="hibernate.connection.username">username@mydatabase.com</property>
  <property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>
 </session-factory>
</hibernate-configuration>

错误:

 java.sql.SQLException: Access denied for user 'username@mydatabase.com'@'111-111-111-111.slkc.qwest.net' (using password: YES)
4

1 回答 1

1

你必须给用户没有访问权限?

CREATE USER `username`@`111-111-111-111.slkc.qwest.net` IDENTIFIED BY 'username' 
GRANT ALL PRIVILEGES mydb.* TO `username`@`111-111-111-111.slkc.qwest.net`;

也许这可以帮助你 java.sql.SQLException: Access denied for user

于 2013-11-01T23:45:46.303 回答