-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: Hibernate no longer able to log in to mySQL
PostPosted: Thu May 20, 2010 9:56 am 
Newbie

Joined: Thu May 20, 2010 9:32 am
Posts: 2
DISCLAIMER: I'm a veteran programmer but brand new to this environment.

Short Version:
After upgrading to a new Mac and transferring everything with Time Machine, my Hibernate(/Spring/Tomcat/Eclipse) gets an "access denied" error when trying to connect to mySQL.

Long Version:
I have a server app built in Eclipse with Hibernate and Spring. Starting from SVN source, I was painstakingly able to get it working on an old Macbook. This week, I upgraded machines and transferred everything over with Time Machine. Now when I start the Tomcat server (running in Eclipse), I get this error:

Code:
Access denied for user 'john'@'%' to database 'uptous'


As I understand it, the credentials for mySQL log-in are configured in hibernate.properties. On the original machine, I set user and password properties, and it has no problem.

Things I have done to isolate this issue:
I checked that mySQL is okay by running ./mysql from the command line with the same username and password.

I changed the username and password in hibernate.properties. The error message still had user 'john'.

I also notice that the message doesn't say (using password: YES) which I would have expected.

I am wondering if I missed some other place where I need to configure this login info? Or did Hibernate build some login record on the old machine and needs to be forced to regenerate it? I apologize if these questions are naive, but I've searched documentationa and help forums without luck. Thank you for any advice.

John


Top
 Profile  
 
 Post subject: Re: Hibernate no longer able to log in to mySQL
PostPosted: Fri May 21, 2010 3:15 am 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
Quote:
Or did Hibernate build some login record on the old machine and needs to be forced to regenerate it?

no nothing is stored elsewhere, it's all in your configuration. You might whish to check that you're actually using your properties file and not another way to configure Hibernate (like the xml, programmatic approach, persistence.xml)
I didn't understand is 'john' as a username is totally wrong.

Also check to have correct authorization relating to the domain name you're using to connect to MySQL. MySQL is very picky about it: you might have authorization connecting to "localhost" but get denied access when connecting to "yourmachinename".

_________________
Sanne
http://in.relation.to/


Top
 Profile  
 
 Post subject: Re: Hibernate no longer able to log in to mySQL
PostPosted: Fri May 21, 2010 3:46 pm 
Newbie

Joined: Thu May 20, 2010 9:32 am
Posts: 2
Thank you. After my post yesterday, I narrowed it down to something like you described. I dumped and recreated the user "john" for "localhost" and "%" and the connection is working.

Now I am on to the next error. :)

Regards,
John


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.