Jira CLI: No suitable driver

We are new to jira and did some first steps with the command line interfces

We installed jira 5.0.1 and atlassian-cli-2.5.0. The jira database is a mysql database (5.0.95). When we try to run the following command:

jira.sh --user <user> --password <password> --server http://nbg1jira1.nashtech.grp:8080 --url http://nbg1jira1.nashtech.grp:8080 --action runFromSql --file "User.sql" --database jira --dbUser <dbuser> --dbPassword <dbpassword> -v --driver "mysql"

Server address: http://nbg1jira1.nashtech.grp:8080/rpc/soap/jirasoapservice-v2
Successful
login to: http://nbg1jira1.nashtech.grp:8080/rpc/soap/jirasoapservice-v2 by user: <user>
9sDT5EXmK5 logged out.

Client error: Could not load database driver: com.mysql.jdbc.Driver. Ensure the jdbc driver is available in the lib/jdbc directory.
org.swift.common.cli.CliClient$ClientException: Could not load database driver: com.mysql.jdbc.Driver. Ensure the jdbc driver is available in the lib/jdbc directory.
at org.swift.common.cli.CliUtils.getDatabaseConnection(CliUtils.java:390)
at org.swift.common.cli.CliClient.getDatabaseConnectionFromParameters(CliClient.java:1271)
at org.swift.common.cli.CliClient.runFromSql(CliClient.java:947)
at org.swift.jira.cli.JiraClient.handleRequest(JiraClient.java:419)
at org.swift.common.cli.AbstractRemoteClient.process(AbstractRemoteClient.java:119)
at org.swift.common.cli.CliClient.doWork(CliClient.java:299)
at org.swift.jira.cli.JiraClient.main(JiraClient.java:146)

I downloaded from the mysql web site the file mysql-connector-java-5.1.10.jar into <cli-root>/lib/jdbc, but then I will get another error when I run the previous command:

Server address: http://nbg1jira1.nashtech.grp:8080/rpc/soap/jirasoapservice-v2
Successful login to: http://nbg1jira1.nashtech.grp:8080/rpc/soap/jirasoapservice-v2 by user: <user>
lbp2HUkn8s logged out.

Client error: Exception getting database connection: No suitable driver
org.swift.common.cli.CliClient$ClientException: Exception getting database connection: No suitable driver
at org.swift.common.cli.CliUtils.getDatabaseConnection(CliUtils.java:392)
at org.swift.common.cli.CliClient.getDatabaseConnectionFromParameters(CliClient.java:1271)
at org.swift.common.cli.CliClient.runFromSql(CliClient.java:947)
at org.swift.jira.cli.JiraClient.handleRequest(JiraClient.java:419)
at org.swift.common.cli.AbstractRemoteClient.process(AbstractRemoteClient.java:119)
at org.swift.common.cli.CliClient.doWork(CliClient.java:299)
at org.swift.jira.cli.JiraClient.main(JiraClient.java:146)

What might be wrong in the installation/query?

5 answers

1 accepted

Accepted Answer
0 votes

The jdbc driver is working. The error comes from the url option. The url below solves my issue:

--url jdbc:mysql://<host>/jira

Glad you resolved it

There is nothing wrong with your installation.

CLI tool requires JDBC drivers in your class path which is not packaged along with it.

Download mysql jdbc drivers and copy it under the lib folder of your CLI tool that will resolve this issue

Just checked

https://plugins.atlassian.com/plugins/org.swift.jira.cli

and

https://plugins.atlassian.com/plugins/org.swift.atlassian.cli

First one does not have any JDBC drivers packaged and Atlassian tool has postgress JDBC drivers. You are trying to use MYSQL you need to copy download and copy them in the lib folders where you have unzipped this tool or provide it in the class path

I alreay download the mysql JDBC driver and copied it into lib/jdbc. Now I get another error:

lient error: Exception getting database connection: No suitable driver
org.swift.common.cli.CliClient$ClientException: Exception getting database connection: No suitable driver
at org.swift.common.cli.CliUtils.getDatabaseConnection(CliUtils.java:392)
at org.swift.common.cli.CliClient.getDatabaseConnectionFromParameters(CliClient.java:1271)
at org.swift.common.cli.CliClient.runFromSql(CliClient.java:947)
at org.swift.jira.cli.JiraClient.handleRequest(JiraClient.java:419)
at org.swift.common.cli.AbstractRemoteClient.process(AbstractRemoteClient.java:119)
at org.swift.common.cli.CliClient.doWork(CliClient.java:299)
at org.swift.jira.cli.JiraClient.main(JiraClient.java:146)

The same JDBC driver works will with other applications, e.g. DbVisualizer.

I already download the mysql JDBC driver and copied it into lib/jdbc. Now I get another error:

Client error: Exception getting database connection: No suitable driver
org.swift.common.cli.CliClient$ClientException: Exception getting database connection: No suitable driver
at org.swift.common.cli.CliUtils.getDatabaseConnection(CliUtils.java:392)
at org.swift.common.cli.CliClient.getDatabaseConnectionFromParameters(CliClient.java:1271)
at org.swift.common.cli.CliClient.runFromSql(CliClient.java:947)
at org.swift.jira.cli.JiraClient.handleRequest(JiraClient.java:419)
at org.swift.common.cli.AbstractRemoteClient.process(AbstractRemoteClient.java:119)
at org.swift.common.cli.CliClient.doWork(CliClient.java:299)
at org.swift.jira.cli.JiraClient.main(JiraClient.java:146)

The same JDBC driver works well with other applications, e.g. DbVisualizer.

I already download different version of the mysql JDBC driver. The JDBC driver works will in other applications, e.g. DbVisualizer.When I copy the JDBC driver in the cli lib folder and run the query again, then I will get the the error:

Client error: Exception getting database connection: No suitable driver
org.swift.common.cli.CliClient$ClientException: Exception getting database connection: No suitable driver
at org.swift.common.cli.CliUtils.getDatabaseConnection(CliUtils.java:392)
at org.swift.common.cli.CliClient.getDatabaseConnectionFromParameters(CliClient.java:1271)
at org.swift.common.cli.CliClient.runFromSql(CliClient.java:947)
at org.swift.jira.cli.JiraClient.handleRequest(JiraClient.java:419)
at org.swift.common.cli.AbstractRemoteClient.process(AbstractRemoteClient.java:119)
at org.swift.common.cli.CliClient.doWork(CliClient.java:299)
at org.swift.jira.cli.JiraClient.main(JiraClient.java:146)

I already download the mysql JDBC driver and copied it into lib/jdbc. Now I get another error:

Client error: Exception getting database connection: No suitable driver
org.swift.common.cli.CliClient$ClientException: Exception getting database connection: No suitable driver
at org.swift.common.cli.CliUtils.getDatabaseConnection(CliUtils.java:392)
at org.swift.common.cli.CliClient.getDatabaseConnectionFromParameters(CliClient.java:1271)
at org.swift.common.cli.CliClient.runFromSql(CliClient.java:947)
at org.swift.jira.cli.JiraClient.handleRequest(JiraClient.java:419)
at org.swift.common.cli.AbstractRemoteClient.process(AbstractRemoteClient.java:119)
at org.swift.common.cli.CliClient.doWork(CliClient.java:299)
at org.swift.jira.cli.JiraClient.main(JiraClient.java:146)

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Tuesday in Featured Groups

Tuesday tips & tricks: What is the Atlassian Community?

It's officially Tuesday, which means it's officially time for another tip to help you better navigate this space we call the Atlassian Community. 😄 I got a great question from community member, Sa...

141 views 6 8
View post

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