Ho appena iniziato a lavorare con Hibernate e quando sto finalmente cercando di lanciare la web-app ottengo il seguente errore:Impossibile connettersi a MySQL - ospite non ammessi
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"
Che è davvero frustrante. Perché non sono un localhost? Che cos'è 192.168.1.7? Potrei semplicemente concedere privilegi come suggeriscono le risposte a domande simili, ma perché non sono localhost?
Capisco il problema qui, l'impostazione hbm2ddl è impostata per la creazione, quindi vuole creare le tabelle specificate ma non ottiene l'autorizzazione dal server MySQL.
Sto sviluppando un'app struts2/hibernate in Eclipse e utilizzo Tomcat e ovviamente MYSQL.
Grazie in anticipo!
EDIT: (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>
Ok, e anche le altre proprietà sono impostate su valori corretti? –
Controlla la modifica nel post di domanda qui sopra, non penso che l'errore ci sia, dai un'occhiata per favore! –