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'@'' (using password: YES)

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


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., 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 “” in the “url” attribute with “”, but this didn’t achieve anything. In the end, I figured out that specifying “localhost” was the answer:


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.

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, as it seems the login to localhost is matching some other user entirely?


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).



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