title: Cannot connect to MySQL - host not allowed
body: <p>I've just started working with Hibernate and when I'm finally trying to launch the web-app I get the following error: </p>
  
  <pre><code>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"
  </code></pre>
  
  <p>Which is really frustrating. Why aren't I a localhost? What is 192.168.1.7? I could just grant privileges like the answers to similar questions suggest but why aren't I localhost? </p>
  
  <p>I understand the problem here, the hbm2ddl setting is set to create, so it wants to create the given tables but doesn't get permission from the MySQL-server.</p>
  
  <p>I'm developing a struts2/hibernate app in Eclipse and I use Tomcat and of course MYSQL.</p>
  
  <p>Thanks in advance!</p>
  
  <p>EDIT: (hibernate.cfg.xml)</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;!DOCTYPE hibernate-configuration PUBLIC
  "-//Hibernate/Hibernate Configuration DTD//EN"
  "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd"&gt;
  &lt;hibernate-configuration&gt;
  &lt;session-factory&gt;
      &lt;property name="connection.driver_class"&gt; com.mysql.jdbc.Driver&lt;/property&gt;
      &lt;property name="connection.url"&gt;jdbc:mysql://localhost:3306/clothes&lt;/property&gt;
      &lt;property name="connection.username"&gt;root&lt;/property&gt;
      &lt;property name="connection.password"&gt;root&lt;/property&gt;
  
      &lt;property name="connection.pool_size"&gt;1&lt;/property&gt;
      &lt;property name="dialect"&gt; org.hibernate.dialect.MySQLDialect&lt;/property&gt;
  
      &lt;property name="show_sql"&gt;true&lt;/property&gt;
  
      &lt;!-- Needs to be disabled in production! --&gt;
      &lt;property name="hbm2ddl.auto"&gt;create&lt;/property&gt;
  
      &lt;mapping class="johanstenberg.clothes.serverobjects.AdEntity"/&gt;
      &lt;mapping class="johanstenberg.clothes.serverobjects.AuthenticationEntity"/&gt;
      &lt;mapping class="johanstenberg.clothes.serverobjects.UserEntity"/&gt;
      &lt;mapping class="johanstenberg.clothes.serverobjects.VerificationKeyEntity"/&gt;
  &lt;/session-factory&gt;
  &lt;/hibernate-configuration&gt;
  </code></pre>