Win a copy of Java 9 Revealed this week in the Features new in Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Access denied for user 'root'@'localhost' (using password: YES)  RSS feed

 
Sree Kumari
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I started using Hibernate4.5.1 wrote a simple program,created a new database but it is showing Access denied for user 'root'@'localhost' (using password: YES) error the previous versions are working fine with old databases

 
Jaikiran Pai
Sheriff
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It looks like your database credentials that you have configured in Hibernate are incorrect. Have you verified them?
 
Bin Smith
Ranch Hand
Posts: 514
1
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The defaults for mysql 5 are :
username = root
password is empty string.

In hibernate.cfg.xml:

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!