Error trying to connect to Confluence DB using CLI

Hi ,

I am trying to connect the confluence DB from the CLI

I made sure that the host name and DB name is proper , Also copied te mySQL jar in the CLI folder.

PFB the command and error i get ,

./ --action runFromSql --sql "select 'getServerInfo' as action from test01 limit 2" --host "myhostname" --driver "mysql" --database "confluencedb"

Client error: Exception getting database connection: Could not create connection to database server. Attempted reconnect 3 times. Giving up.

Could any one please help in resoving this error .


Aravind N.S

2 answers

The error indicates that the JDBC driver has been found ok and it has attempted to contact the database at the host location you specified.

  1. Make sure the host is a valid location from the client you are using (ping for example)
  2. Make sure the database server allows connections from the client's address

Hi Aravind,

I would check a couple things:

First, double-check that the JDBC driver for mySQL is in CLI's lib folder.

If this doesn't resolve your issue, I would try the suggestion given in this answer ( in reference to the Jira CLI:

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

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

In your case, I would assume <host> would be the same as what you are using with your --host arguement.

Hope this helps!

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Dec 18, 2018 in Confluence Cloud

Happy holidays from our team to yours!

Hi Community!  2018 was filled with changes for our team, both big and small, and we've taken a lot of time to both celebrate our wins and recognize areas of improvement. One thing that we're a...

482 views 3 18
Read article

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