Hibernate の使用を開始したばかりで、最終的に Web アプリを起動しようとすると、次のエラーが発生します。
2012-nov-14 12:54:23 org.hibernate.tool.hbm2ddl.SchemaExport execute
ERROR: HHH000231: Schema export unsuccessful
java.sql.SQLException: null, message from server: "Host '192.168.1.7' is not allowed to
connect to this MySQL server"
これは本当にイライラします。なぜ私はローカルホストではないのですか? 192.168.1.7 とは何ですか? 同様の質問への回答が示唆するように特権を付与することもできますが、なぜローカルホストではないのですか?
ここで問題を理解しています.hbm2ddl設定は作成するように設定されているため、指定されたテーブルを作成しようとしていますが、MySQLサーバーから許可を得ていません.
私は Eclipse で struts2/hibernate アプリを開発しており、Tomcat ともちろん MYSQL を使用しています。
前もって感謝します!
編集: (hibernate.cfg.xml)
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD//EN"
"http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="connection.driver_class"> com.mysql.jdbc.Driver</property>
<property name="connection.url">jdbc:mysql://localhost:3306/clothes</property>
<property name="connection.username">root</property>
<property name="connection.password">root</property>
<property name="connection.pool_size">1</property>
<property name="dialect"> org.hibernate.dialect.MySQLDialect</property>
<property name="show_sql">true</property>
<!-- Needs to be disabled in production! -->
<property name="hbm2ddl.auto">create</property>
<mapping class="johanstenberg.clothes.serverobjects.AdEntity"/>
<mapping class="johanstenberg.clothes.serverobjects.AuthenticationEntity"/>
<mapping class="johanstenberg.clothes.serverobjects.UserEntity"/>
<mapping class="johanstenberg.clothes.serverobjects.VerificationKeyEntity"/>
</session-factory>
</hibernate-configuration>