BitBucket Server says com.mysql.jdbc.Driver is not available even though the jar is there

Domagoj Polović
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 24, 2017

I've just upgraded our BitBucket Server to 5.2.2 and it won't start with an error message: "The database, as currently configured, is not accessible. Bitbucket is configured to use the mysql driver (com.mysql.jdbc.Driver) but it is not available.".

 

This is not the first time I was upgrading the BitBucket Server. As it was with the last time I was upgrading it, I've put the latest jdbc driver (mysql-connector-java-5.1.43-bin.jar) in the /opt/atlassian/bitbucket/5.2.2/lib folder. It doesn't matter if I start it with service atlbitbucket start or 5.2.2/bin/start-bitbucket.sh commands, the error is always there.

Is this a known issue and can it be resolved?

2 answers

1 accepted

8 votes
Answer accepted
Domagoj Polović
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 26, 2017

The lib folder was moved to /var/atlassian/application-data/bitbucket/lib, placing the mysql-connector-java-5.1.43-bin.jar file there solved the issue.

Dennis van Berkel
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 30, 2017

That did it for me! Thanks.

Marko Petelin
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 8, 2017

did it also for me after a G search... 

I suggest Atlassian team to update the page Connecting Bitbucket Server to MySQL with a note that informs that from Bitbucket 5.x by default home dir in linux envs has been moved in /var folder.

Spencer Varney
Contributor
September 8, 2017

Had to figure this out for Windows Server 2008 R2 Sp1 - we were getting the same error when trying to launch it in the browser. With a default install of Bitbucket 5.x the path is apparently:
C:\Atlassian\Bitbucket\5.x\app\WEB-INF\lib

(where you find the other .jar files). Once we copied the connector there, it worked out.

Like Jurgen Schober likes this
Michael Gaskin November 7, 2017

Thanks Spencer, worked perfectly... Updated docs are needed.

Bill Mowery
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 23, 2019

This is also a problem in the Windows (Server 2016) and BitBucket (Version 6.2) install as well. The proper location for the driver is <AppData>/Bitbucket/lib. If you follow the instructions as published you'll lose your mind trying to connect to MySQL.

Chris Collins
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 22, 2020

OMG thank you so much Bill.  Saved my life with that tip.  Thank you!  :)

0 votes
Domagoj Polović
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 26, 2017

Will there any help with this?

Hua Soon SIM _Akeles_
Atlassian Partner
May 16, 2018

It also works if the sql connector jar file is copied to 

<bitbucket-home>/lib

The advantage is that the customisation will persists across upgrades.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events