Setting up Mysql DB giving a connection error

My Jira seems to be not connecting to the External MySQL DB.

To erradicate any DB issues, I tested the credentials using MySQL workbench and Glassfish server and managed to verify the information I entered was correct.

Afterwards I used the dbconfig.xml as per https://confluence.atlassian.com/display/JIRA052/Connecting+JIRA+to+MySQL#ConnectingJIRAtoMySQL-4.2ConnectingJIRAtoMySQLManually, and didnt have much luck with it too.

I then tried different settings on the URL and as soon as I removed parameteres on it the connection seems to work. Afterwards I tries different combinations and it seems that sessionVariables=storage_engine=InnoDB and useUnicode=true&characterEncoding=UTF8 doesnt seems to be working together, however if I only use one of them at a time it works perfectly.

My question is, do I need to have them there, and if so whats the most important parameter to have and what can I exclude from it?

4 answers

1 accepted

Hi Guys

Sorry it took a while to get back to you good people.

I found the answer to problem, it was down to my "MySQL/J connector", a similar issue (click here) was raised and when I investigated I found out that my connector was an affected version. Basically we shouldnt use MySQL/J connector versions between "5.1.15" till "5.1.18" when using JIRA.

I upgraded to lates (I think its now .22 or so) and it all started working well.

Thanks for help though.

Regards

Yohan

Hi Yohan

1. First, check that the database is created on the MySQL instance and you grant the user the privileges to modify the database.

2. You do not need the sessionVariables and storage engine variables. I do not have those attribues and it works fine on my instance.

I have these parameters on my server.xml/dbconfig.xml (in the new version)

url="jdbc:mysql://XX.xx.xx.xxx/jiradb4?useUnicode=true&characterEncoding=UTF8"

3. Make sure you delete these two lines, as you are not using an HSQL database

minEvictableIdleTimeMillis="4000"
timeBetweenEvictionRunsMillis="5000"

4. Make sure entity.xml is amended.(database type = mysql)

Hope it helps.

Rahul

0 votes

Please try use the JIRA configuration Tool for test the DB connection there.

0 votes
Daryl Chuah Atlassian Team Jan 06, 2013

Hi Yohan

The important parameter you need to fill it up in the dbconfig.xml is :

<name>defaultDS</name>
<delegator-name>default</delegator-name>
<database-type>mysql</database-type>
<jdbc-datasource>
<url>jdbc:mysql://dbserver:3306/jiradb?useUnicode=true&amp;characterEncoding=UTF8&amp;sessionVariables=storage_engine=InnoDB</url>
<driver-class>com.mysql.jdbc.Driver</driver-class>
<username>jiradbuser</username>
<password>password</password>
others you can use the default value given in it.

Suggest an answer

Log in or Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

2,781 views 11 18
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot