Forums

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

Not able to connect mysql to JIRA

DEEPAK BHATIA September 17, 2018

Hi,

==============================================

2018-09-17 15:23:28,986 JIRA-Bootstrap ERROR      [c.a.jira.health.HealthChecks]
 JIRA couldn't connect to your database
2018-09-17 15:23:28,987 JIRA-Bootstrap ERROR      [c.a.jira.health.HealthChecks]
 JIRA failed to establish a connection to your database.
    This could be because:
        - Your database isn't running
        - The configuration of your dbconfig.xml file is incorrect (user, passwo
rd, or database URL etc.)
        - There is a network issue between JIRA and your database (e.g. firewall
, database doesn't allow remote access etc.)

    There are several other solutions you can try, review our documentation and
see what works for you.

================================================

Points to note:

1. I have turned off Firewall.

2. Database is running on port 3306.

3. dbconfig.xml is given below

<?xml version="1.0" encoding="UTF-8"?>

<jira-database-config>
  <name>defaultDS</name>
  <delegator-name>default</delegator-name>
  <database-type>mysql</database-type>
  <schema-name>PUBLIC</schema-name>
  <jdbc-datasource>
  <url>jdbc:mysql://127.0.0.1:3306/jiradb?useUnicode=true&amp;characterEncoding=UTF8&amp;sessionVariables=default_storage_engine=InnoDB</url>
    <driver-class>com.mysql.cj.jdbc.Driver</driver-class>
    <username>root</username>
    <password></password>
    <pool-min-size>20</pool-min-size>
    <pool-max-size>20</pool-max-size>
    <pool-max-wait>30000</pool-max-wait>
    <min-evictable-idle-time-millis>4000</min-evictable-idle-time-millis>
    <time-between-eviction-runs-millis>5000</time-between-eviction-runs-millis>
    <pool-max-idle>20</pool-max-idle>
    <pool-remove-abandoned>true</pool-remove-abandoned>
    <pool-remove-abandoned-timeout>300</pool-remove-abandoned-timeout>
  </jdbc-datasource>
</jira-database-config>

 

 

2 answers

1 accepted

0 votes
Answer accepted
DEEPAK BHATIA September 17, 2018

Thanks friends, I have resolved this.

I ran config.bat and saved  its dbconfig.xml.

Then I downloaded the mysql-connector-java-5.1.46, which worked for me.

<?xml version="1.0" encoding="UTF-8"?>

<jira-database-config>
  <name>defaultDS</name>
  <delegator-name>default</delegator-name>
  <database-type>mysql</database-type>
  <jdbc-datasource>
    <url>jdbc:mysql://address=(protocol=tcp)(host=localhost)(port=3306)/jiradb?useUnicode=true&amp;characterEncoding=UTF8&amp;sessionVariables=default_storage_engine=InnoDB</url>
    <driver-class>com.mysql.jdbc.Driver</driver-class>
    <username>root</username>
    <password></password>
    <pool-min-size>20</pool-min-size>
    <pool-max-size>20</pool-max-size>
    <pool-max-wait>30000</pool-max-wait>
    <validation-query>select 1</validation-query>
    <min-evictable-idle-time-millis>60000</min-evictable-idle-time-millis>
    <time-between-eviction-runs-millis>300000</time-between-eviction-runs-millis>
    <pool-max-idle>20</pool-max-idle>
    <pool-remove-abandoned>true</pool-remove-abandoned>
    <pool-remove-abandoned-timeout>300</pool-remove-abandoned-timeout>
    <pool-test-on-borrow>false</pool-test-on-borrow>
    <pool-test-while-idle>true</pool-test-while-idle>
    <validation-query-timeout>3</validation-query-timeout>
  </jdbc-datasource>
</jira-database-config>

0 votes
Rambabu Patina _Appfire_
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.
September 17, 2018

@DEEPAK BHATIA, Are you able to ping your Database server as like below:

ping 123.456.789.012 (i.e your database URL)

For reference you can go through the article for usual database connection problems.

DEEPAK BHATIA September 17, 2018

Thanks, Yes I am able to ping 127.0.0.1.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events