Error connecting to database

I am reinstalling Jira to our new Linux server and I got this error:

Error connecting to database

Cannot load connection class because of underlying exception: com.mysql.cj.core.exceptions.WrongArgumentException: Malformed database URL, failed to parse the connection string near '=InnoDB'.

Originally it said that the mysql connector file was missing so I put 'mysql-connector-java-6.0.6.jar' into the lib folder as directed. Now I have a new error that I just don't know how to fix. I have set up a brand new database.

3 answers

I had the same problem.

In my case I was using the wrong driver version.

I used version 6.0.6, but the correct version is 5.1.44

Take a look at the documentation about Copy the MySQL JDBC driver to your application server

The documentation says

  • If you are installing JIRA, download the recommended MySQL driver JDBC Connector/J 5.1. You can download either the .tar.gz or the .zip file by selecting the 'Platform Independent' option. Extract the jar for the driver (e.g. mysql-connector-java-5.x.x-bin.jar) from the archive.

I downloaded the driver from the central maven repository: mysql » mysql-connector-java

using

wget http://central.maven.org/maven2/mysql/mysql-connector-java/5.1.44/mysql-connector-java-5.1.44.jar

 

 

 

 

 

Thanks! I got same error and the old mysql-connector-java-5.1.46.jar fixed it.

I'm setting up Jira on Ubuntu 16.04, MySQL 5.7 all dancing on VMware. 

I'm thinking the documentation isn't clearly stating, "please use the old drivers". I ran into the same scenario setting up Conflunence, it wanted an old driver.

Thanks again for this post.

1 vote

You've given the setup an incorrect or badly formed url when ytying to connect.  We need to see that.

Depending on how far through the install you've got, there are two possibilities.

1.  There's a file in your JIRA home directory called dbconfig.xml which has the connection settings in it.  We just need to see the connection string out of that, not username and password etc.

2.  What are you entering when the system asks you for the database connection details

I don't see any dbconfig.xml file under Jira. I see a lock file.

Here is a photo from my screen

Screen.jpg

Ok, it's not been able to connect, so it has not created the dbconfig file.  I sort of expected that, but had to check.

The parameters you are entering look good to me, so I'm not sure what is wrong.

Next thing to do is a look at the log file, which should tell us the full reason for the failure and contain the string it has constructed to try the connection.  Should be under "logs" in the directory you found the lock file.

 ---------------------------------------------------------------------------------
      Heap memory     :  Used:  125 MiB.  Committed:  491 MiB.  Max:  734 MiB
      Non-heap memory :  Used:   65 MiB.  Committed:   67 MiB.  Max: 1264 MiB
    ---------------------------------------------------------------------------------
      TOTAL           :  Used:  190 MiB.  Committed:  558 MiB.  Max: 1998 MiB
    ---------------------------------------------------------------------------------
2017-07-02 01:37:16,262 http-nio-8080-exec-17 ERROR anonymous 97x22x1 1y1dl5o 98.24.51.78 /secure/SetupDatabase!connectionCheck.jspa [c.a.config.bootstrap.DefaultAtlassianBootstrapManager] Could not successfully test your database: 
java.sql.SQLNonTransientConnectionException: Cannot load connection class because of underlying exception: com.mysql.cj.core.exceptions.WrongArgumentException: Malformed database URL, failed to parse the connection string near '=InnoDB'.
 at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:526)
 at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:513)
 at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:505)
 at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:479)
 at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:489)
 at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:72)
 at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:124)
 at com.mysql.cj.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:224)
 at java.sql.DriverManager.getConnection(DriverManager.java:664)
 at java.sql.DriverManager.getConnection(DriverManager.java:247)
 at com.atlassian.config.bootstrap.DefaultAtlassianBootstrapManager.getTestDatabaseConnection(DefaultAtlassianBootstrapManager.java:347)
 at com.atlassian.jira.config.database.JdbcDatasource.getConnection(JdbcDatasource.java:211)
 at com.atlassian.jira.config.database.DatabaseConfig.testConnection(DatabaseConfig.java:87)
 at com.atlassian.jira.web.action.setup.SetupDatabase.testConnection(SetupDatabase.java:225)
 at com.atlassian.jira.web.action.setup.SetupDatabase.doValidation(SetupDatabase.java:189)
 at com.atlassian.jira.web.action.setup.SetupDatabase.doConnectionCheck(SetupDatabase.java:121)
 ... 3 filtered
 at java.lang.reflect.Method.invoke(Method.java:498)
 at webwork.util.InjectionUtils$DefaultInjectionImpl.invoke(InjectionUtils.java:70)
 at webwork.util.InjectionUtils.invoke(InjectionUtils.java:56)
 ... 2 filtered
 at com.atlassian.jira.action.JiraActionSupport.execute(JiraActionSupport.java:63)
 ... 7 filtered
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:725)
 ... 48 filtered
 at com.atlassian.jira.security.JiraSecurityFilter.doFilter(JiraSecurityFilter.java:70)
 ... 73 filtered
 at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
 at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
 at java.lang.Thread.run(Thread.java:745)
Caused by: com.mysql.cj.core.exceptions.UnableToConnectException: Cannot load connection class because of underlying exception: com.mysql.cj.core.exceptions.WrongArgumentException: Malformed database URL, failed to parse the connection string near '=InnoDB'.
 at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
 at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
 at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
 at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
 at com.mysql.cj.core.exceptions.ExceptionFactory.createException(ExceptionFactory.java:54)
 ... 152 more
Caused by: com.mysql.cj.core.exceptions.WrongArgumentException: Malformed database URL, failed to parse the connection string near '=InnoDB'.
 at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
 at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
 at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
 at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
 at com.mysql.cj.core.exceptions.ExceptionFactory.createException(ExceptionFactory.java:54)
 at com.mysql.cj.core.conf.url.ConnectionUrlParser.parseQuerySection(ConnectionUrlParser.java:491)
 at com.mysql.cj.core.conf.url.ConnectionUrlParser.getProperties(ConnectionUrlParser.java:616)
 at com.mysql.cj.core.conf.url.ConnectionUrl.collectProperties(ConnectionUrl.java:307)
 at com.mysql.cj.core.conf.url.ConnectionUrl.<init>(ConnectionUrl.java:292)
 at com.mysql.cj.core.conf.url.SingleConnectionUrl.<init>(SingleConnectionUrl.java:38)
 at com.mysql.cj.core.conf.url.ConnectionUrl.getConnectionUrlInstance(ConnectionUrl.java:202)
 at com.mysql.cj.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:194)
 ... 151 more

Ok. Can you look back through the log from there?  You should find a line in it that says "Database URL" - what does that say?

I had the same problem. In my case I was using the wrong driver version. I used 6.0.6.

The version that works for me is 5.1.44.

Take a look at the documentation Copy the MySQL JDBC driver to your application server

It says:

  • If you are installing JIRA, download the recommended MySQL driver JDBC Connector/J 5.1. 
    You can download either the .tar.gz or the .zip file by selecting the 'Platform Independent' option. Extract the jar for the driver (e.g. mysql-connector-java-5.x.x-bin.jar) from the archive.

I downloaded the driver from the central maven repository:

using

wget http://central.maven.org/maven2/mysql/mysql-connector-java/5.1.44/mysql-connector-java-5.1.44.jar

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Sep 18, 2018 in Jira

What modern development practices are at the heart of how your team delivers software?

Hey Community mates! Claire here from the Software Product Marketing team. We all know software development changes rapidly, and it's often tough to keep up. But from our research, we've found the h...

26,468 views 2 7
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