Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Jira database connection

Bastian Stehmann
Community Champion
October 29, 2018

Hi all,

 

I am trying to connect Jira to a MySQL database and I always get an error, that the user can not connect to the database.

I already checked this on the console and there I can connect to the database.

I think, the problem is, that even if I use "localhost" as server, Jira tries to connect with "jirauser"@127.0.0.1 instead of "jirauser"@"localhost".

Any ideas how I can tell jira to connect to the database using the hostname instead of the IP?

2 answers

0 votes
Dave Theodore [Coyote Creek Consulting]
Community Champion
October 29, 2018

Try using the `mysql` client on the operating system to test. ( Man page )You'd use a syntax something like this:

mysql -u jirauser -p -h 127.0.0.1 jiradb

This will try to connect to 127.0.0.1 as "jirauser" and prompt you to enter a password. Once it successfully connects, it will use the "jiradb" database. Assuming all goes well, you will get a mysql shell prompt. If things don't go well, you may bet a more useful error message that will help you troubleshoot. If you are connecting to a remote MySQL server, you will need to grant permissions from the IP of your Jira server and connect to the IP of the MySQL server (instead of 127.0.0.1.)

Pro tip: Older versions of MySQL don't support some special characters ( @ symbol being one that we see a lot.) Try using a password with just letters and numbers if you're using a password with special characters.

Tom Lister
Community Champion
October 29, 2018

I remember now that I had jdbc driver compatibility issues and had to go back a couple of versions on MySQL to resolve it. Might have just been a Mac issue.

Bastian Stehmann
Community Champion
October 29, 2018

Hi,

thanks for your help. If I try to connect 127.0.0.1 it does not work "Access denied for 'jirauser'@'127.0.0.1' (using Password YES)".

If I do the same with localhost, it works. So it seems, that the Problem is, that Jira replaces localhost with 127.0.0.1

Tom Lister
Community Champion
October 30, 2018

Hi

are you saying @Dave Theodore [Coyote Creek Consulting] suggestion for MySQL command line doesn’t work for 127.0.0.1 ?

Tom Lister
Community Champion
October 30, 2018

i'm not sure is this relevant but i've noticed my own MySQL installation has both options defined.

Screenshot 2018-10-30 at 09.34.24.png

Dave Theodore [Coyote Creek Consulting]
Community Champion
October 30, 2018

@Bastian Walger That makes sense.  I'm glad you got it sorted out.

0 votes
Tom Lister
Community Champion
October 29, 2018

What does your dbconfig.xml look like.

I don’t think the localhost. Vs 127.0.0.1 should make a difference. It took a while on my Mac to get them to play nicely but this wasn’t one of the issues

more info here 

https://confluence.atlassian.com/adminjiraserver071/connecting-jira-applications-to-mysql-802592179.html

Suggest an answer

Log in or Sign up to answer