title: Hibernate : Access denied for user 'root'@'localhost' (using password: YES) , but mysql work fine
body: <p>I spend many days to try find problem so plz help me.</p>
  
  <p>I have problem with hibernate with connection to database <strong>always</strong> have Exception  Access denied for user 'root'@'localhost' (using password: YES) even if i have user xx not root.</p>
  
  <p>My hibernate.cfg.xml is:</p>
  
  <pre><code>&lt;hibernate-configuration&gt;
  &lt;session-factory&gt;
    &lt;property name="hibernate.dialect"&gt;org.hibernate.dialect.MySQLDialect&lt;/property&gt;
    &lt;property name="hibernate.connection.driver_class"&gt;com.mysql.jdbc.Driver&lt;/property&gt;
    &lt;property name="hibernate.connection.url"&gt;jdbc:mysql://localhost:3306/user&lt;/property&gt;
    &lt;property name="hibernate.connection.username"&gt;wojtek&lt;/property&gt;
    &lt;property name="hibernate.connection.password"&gt;xx&lt;/property&gt;
    &lt;mapping resource="program/Members.hbm.xml"/&gt;
  &lt;/session-factory&gt;
  &lt;/hibernate-configuration&gt;
  </code></pre>
  
  <p>I see that access denied is for root but in my hibenrate.cfg.xml is wojtek so here must be main problem. </p>
  
  <p>BTW I could normal connect to database form line command as root or wojtek , aplication using jdbc too could connect but only with Hibernate i have access denied with wrong user.</p>