Announcement Announcement Module
Collapse
No announcement yet.
[''@'localhost' does not have access] error while connecting to database Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • [''@'localhost' does not have access] error while connecting to database

    I spent more than 3 days trying to debug this error. Hence sharing this solution with all:

    My set up
    1.Windows 7 Pro 64 bits running in a Parallels Desktop virtual machine on Apple MacBook Pro.
    2.SpringSource Tool Suite Version: 2.6.1.RELEASE Build Id: 201105041000 (64 bits).
    3.MySQL 5.5 (64 bits)

    I could connect to MySQL server using MySQL Workbench 5.2 CE (32 bits) without any problem. However my Spring MVC project was not connecting to MySQL at all even though both are on the same machine. I double checked the RESOURCE definition in Server's 'context.xml' as well as the complete set up multiple times. Everything was as per the documentation.

    Finally I decided to abandon the Windows installation of STS and MySQL and decided to try installing+running both on my Apple MacBook Pro directly thinking that the virtual machine is somehow messing up the connection even though I could go to internet from Windows without any problem.

    I had to choose between 32 bit and 64 bit installations for MySQL on my MacBook Pro and at that time I noticed that my Mac OS X 10.6.7 kernel was running at 32 bits! So I was running a 64 bit Windows 7 Pro on a 32 bit Mac OS X!!

    Once I changed my Mac OS X 10.6.7 kernel to 64 bits, restarted my Mac, and restarted Windows VM, I was able to connect to MySQL from my Spring MVC application without any problem.
Working...
X