Could not find driver with class name: com.mysql.jdbc.Driver in ubuntu

Vinod Bathi February 7, 2020

I have installed Jira as service, while I was trying to set up the database I am getting an error "Could not find driver with class name: com.mysql.jdbc.Driver" please help in this case.

Could not find driver with class name: com.mysql.jdbc.Driver

Server: Ubuntu 18.04.3 (LTS) x64

Database: mysql 5.7

jira version: 8.7

2020-02-07_17-45-51.png

3 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

1 vote
Answer accepted
Alexis Robert
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 7, 2020

Hi @Vinod Bathi , 

 

this is because the MySQL driver is not bundled with the Jira installation package. You need to download it here : https://dev.mysql.com/downloads/connector/j/5.1.html

And then unzip it and move the jar file in <Jira-installation-directory>/lib

You can find the full procedure here : https://confluence.atlassian.com/adminjiraserver/connecting-jira-applications-to-mysql-5-7-966063305.html

 

Let me know if this helps, 

 

--Alexis

Vinod Bathi February 7, 2020

Hi @Alexis Robert ,

After following your answer, my error has been changed, a new error has been thrown.

"Error connecting to database

Communications link failure The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.

hostname: Temporary failure in name resolution"

2020-02-08_00-18-09.png

Alexis Robert
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 7, 2020

Hi @Vinod Bathi , 

 

in "hostname", just put "localhost" (without the quotes) and it should all be good.

Like Fei Liang likes this
Vinod Bathi February 7, 2020

Hi @Alexis Robert 

updated as per your instruction, got an error, please find the screenshot, after the error, by following the Connecting Jira applications to MySQL 5.7, i have updated my.cnf , unable to start mysql server2020-02-08_11-04-44.png

Vinod Bathi February 9, 2020

Hi @Alexis Robert ,

can you please me in this issue.

 

Regards,

Vinod

3 votes
Yassin BEN-NACEUR _FlowZess_
Contributor
March 26, 2021

Please follow these steps: i had the same problem and this helped:

- Go to https://dev.mysql.com/downloads/connector/j/8.0.html

- Choose "Platform independent"  instead of (Ubuntu, ...)

- Download the ZIP File: Platform Independent (Architecture Independent), Compressed TAR Archive

- Unzip it

- Copy the .JAR file from ~/Downloads/mysql-connector-java-8.0.23/mysql-connector-java-8.0.23.jar to your installation directory (/opt/atlassian/jira/lib)

- make sure the file is there: ll /opt/atlassian/jira/liba | grep mysql

- restart jira: Go to /opt/atlassian/bin and run ./stop-jira.sh then run ./start-jira.sh

shujiYuan
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!
October 21, 2021

thank u, you save my day.

0 votes
Odyssey Shipping Ltd
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!
November 24, 2020

I've done all this but still receiving the original error:

Could not find driver with class name: com.mysql.jdbc.Driver

The documentation is not crystal clear.

- I d/l the mysql gzip file

- moved the file to /opt/atlassian/jira/lib/

- ran the tar command

- it created a directory: mysql-connector-java-5.1.49

- restarted jira

- same error