Jira connects to the bad database

Hello !

We have a production server and a test one.

Recently, to prepare the migration to last version of Jira, we made a copy of the production server to replace the test server. I've changed the jira/dbconfig.xml file to specify the test database but it still tries to connect to the production database. Il the log file of the test server, I have this :

com.atlassian.jira.exception.DataAccessException: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Access denied for user 'jira'@'a.b.c.d' to database 'jira'

In dbconfig.xml, I have this :

<database-type>mysql</database-type>
<schema-name>jiratest</schema-name>
<jdbc-datasource>
<url>jdbc:mysql://my.dbserver.fr:3306/jiratest?useUnicode=true&amp;characterEncoding=utf8&amp;sessionVariables=storage_engine=InnoDB</url>

Any idea ?

5 answers

1 accepted

This widget could not be displayed.

I finally found where was the problem !

Production server is configured to access website by a classical URL instead of :8080 port. When copying the production server to replace the test one, production config has been copied too. I access test server by its IP address but virtual host config and worker-properties config in Apache were prior to dbconfig.xml and that's why test server tried to connect to the production database.

Problem solved ! Now I can try to migrate Jira to the newest version on the test server.

This widget could not be displayed.

jira.home must be pointing to some other home directory. It can be set by system property, or in jira-application.properties... check both of those.

Or for a quick check make dbconfig.xml invalid by removing some xml tag, and make sure you get an error about that on startup.

The other possibility is that you also have a JNDI name in dbconfig.xml, with the datasource defined in your server.xml, but seems unlikely.

This widget could not be displayed.

Did you try restarting the test instance so that the changes in dbconfig.xml is picked up?

Rahul

This widget could not be displayed.

I've found there are two dbconfig.xml files on the server !

One in jira directory and one in data directory and the real one is the second one !

Right, so my answer was basically correct.

This widget could not be displayed.

In fact, it's not OK !

I've changed url in jira/dbconfig.xml, in data/jira/dbconfig.xml and in jira/atlassian-jira/WEB-INF/classes/database-defaults/mysql.properties but after restarting Jira, it still shows this ural in administration/system/troubleshooting and support/system informations :

Adresse JNDI de la base de données mysql jdbc:mysql://mydbserver:3306/jira?useUnicode=true&characterEncoding=UTF8&sessionVariables=storage_engine=InnoDB
URL de la base de données

jdbc:mysql://mydbserver:3306/jira?useUnicode=true&characterEncoding=UTF8&sessionVariables=storage_engine=InnoDB

In witch file is defined JNDI database address ?

I've renamed the two dbconfig.xml files and restarted Jira and Jira started with the JNDI and URL given in my previous message !

So these values are recorded somewhere else but where ?

I finally found where was the problem !

Production server is configured to access website by a classical URL instead of :8080 port. When copying the production server to replace the test one, production config has been copied too. I access test server by its IP address but virtual host config and worker-properties config in Apache were prior to dbconfig.xml and that's why test server tried to connect to the production database.

Problem solved ! Now I can try to migrate Jira to the newest version on the test server.

Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted yesterday in New to Jira

Are you planning to trial, or are currently trialling Jira Software? - We want to talk to you!

Hello! I'm Rayen, a product manager at Atlassian. My team and I are working hard to improve the trial experience for Jira Software Cloud. We are interested in   talking to 20 people planning t...

46 views 1 0
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