Confluence Install – Datasource “Access denied for user” Error

by Michael Scepaniak on December 21, 2008 in software development

I was trying to install a Confluence instance in my hosting account. I had gone through the install and setup successfully locally on my Mac. But the setup on the host was failing:

I kept receiving some sort of access error:
Access denied for user 'foo_user'@'dz64.dailyrazor.com' (using password: YES)

I tried establishing the database connection manually through DbVisualizer, which worked fine:

jdbc:mysql://domain.com:3306/db_name?autoReconnect=true

I looked more closely at the error and realized that something was appending the username with the individual server my account was being hosted on (i.e., dz64.dailyrazor.com). I had a hard time figuring out who was at fault – Confluence, Tomcat, DBCP, or MySQL.

The source of the problem appeared to be my Tomcat resource definition:

Googling around didn’t provide me any answers. I tried replacing “domain.com” in the “url” attribute with “dz64.dailyrazor.com”, but this didn’t achieve anything. In the end, I figured out that specifying “localhost” was the answer:

url="jdbc:mysql://localhost:3306/db_name?autoReconnect=true"

This is what I was doing on my Mac, but it took me a while to figure out that the same had to be done on my host.

Mike
Want to be notified when new articles are posted?
Enter your email address:

{ 2 comments… read them below or add one }

Mark Matthews September 7, 2010 at 11:26 am

That “something” is MySQL. Users in the MySQL grants system are a pair, user + host they connect from. Before assuming that “localhost” fixes your problem, I would read up on how the privilege system works at http://dev.mysql.com/doc/refman/5.1/en/privilege-system.html, as it seems the login to localhost is matching some other user entirely?

Reply

Michael Scepaniak September 7, 2010 at 4:59 pm

Thanks for the input Mark! I no longer maintain a Confluence installation, but this is good to know for future reference (and for anyone that finds this post).

Mike….

Reply

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed

Previous post:

Next post:

Member of The Internet Defense League