Setting up Mysql DB giving a connection error

Yohan Fernando January 6, 2013

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

0 votes
Answer accepted
Yohan Fernando January 14, 2013

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

0 votes
darylchuah
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 6, 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.
0 votes
John Chin
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 6, 2013

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

0 votes
Rahul Aich [Nagra]
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.
January 6, 2013

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&amp;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

Suggest an answer

Log in or Sign up to answer