Database: JIRA couldn't connect to your database

Corey Manshack October 23, 2018

I'm having an issue with Jira using mysql. It was working flawlessly but now after migrating this stack to a different machine it quit working. I can login just fine to mysql with the credentials in dbconfig.xml. The host and port are returning mysql login prompts when I telnet to them so I'm stumped as to where I need to look next to solve this problem.

2 answers

1 accepted

1 vote
Answer accepted
josh
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 23, 2018

Try replacing "localhost" with 127.0.0.1, that's worked for me a couple times.

 

Also, can you check the logs for Jira and post what message you're getting?

Corey Manshack October 23, 2018

Logs just kept saying there was something wrong with the credentials. I erased the password and repasted it and worked. Very odd because, it was the same password, nothing changed. I rsynced everything on this machine directly from the other working machine.

Andy Heinzer
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 23, 2018

Thanks for posting back with your solution.  That is very strange.  The database password would be stored in cleartext in the dbconfig.xml file.  I'm curious if perhaps you were changing between operating systems (Windows to Linux or vice versa) and if these two operating systems were using different character encodings for certain characters.

Without revealing your database credentials, does your username/password for the database contain any special characters?   Anything aside the common characters of A-Z, a-z, 0-9, !@#$%^&*()-_;',. character sets?

1 vote
Andy Heinzer
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 23, 2018

MySQL is the one supported database for Jira that Atlassian cannot bundle the database driver for (due to licensing restrictions).   Instead you, as the admin of your system, have to download this jdbc driver separately from MySQL's site and copy this .jar file into your $JIRAINSTALL/lib/ folder and restart Jira, before Jira can make any connections to that database type.

This is explained in the Connecting Jira to MySQL database documentation.

Also when you download the driver, make sure you get the JDBC Connector/J 5.1 version, and not the 6.x or 8.x jdbc driver versions.  Jira won't work with these newer database/drivers yet.

Corey Manshack October 23, 2018

mysql-connector-java-5.1.34-bin.jar already exists in this directory.

Celtis Omaris April 12, 2021

This really helped thanks,

I had upgraded my DB from 5.7 to 8 and didn't update the .jar and when I did, poof, it worked

Suggest an answer

Log in or Sign up to answer