close

[Solved] Reason: Failed to load driver class com.mysql.jdbc.Driver

Hello Guys, How are you all? Hope You all Are Fine. Today I am trying to use mysql with spring boot but I am facing following error Reason: Failed to load driver class com.mysql.jdbc.Driver in Java. So Here I am Explain to you all the possible solutions here.

Without wasting your time, Let’s start This Article to Solve This Error.

How Reason: Failed to load driver class com.mysql.jdbc.Driver Error Occurs ?

I am trying to use mysql with spring boot but I am facing following error.

Reason: Failed to load driver class com.mysql.jdbc.Driver; in either of HikariConfig class loader or Thread context classloader

How To Solve Reason: Failed to load driver class com.mysql.jdbc.Driver Error ?

  1. How To Solve Reason: Failed to load driver class com.mysql.jdbc.Driver Error ?

    To Solve Reason: Failed to load driver class com.mysql.jdbc.Driver Error You Just need to add dependency mysql-connector-java. Now, Your error must be solved. Second Solution is Just need to downgrade mysql-connector-java to version 5.1.38

  2. Reason: Failed to load driver class com.mysql.jdbc.Driver

    To Solve Reason: Failed to load driver class com.mysql.jdbc.Driver Error You Just need to add dependency mysql-connector-java. Now, Your error must be solved. Second Solution is Just need to downgrade mysql-connector-java to version 5.1.38

Solution 1: add dependency

You Just need to add dependency.

<dependency>
     <groupId>mysql</groupId>
     <artifactId>mysql-connector-java</artifactId>
</dependency>

Now, Your error must be solved.

Solution 2: downgrade mysql-connector-java to version 5.1.38

Just need to downgrade mysql-connector-java to version 5.1.38

    <dependency>
        <groupId>mysql</groupId>
        <artifactId>mysql-connector-java</artifactId>
        <version>5.1.38</version>
    </dependency>

Summary

It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you?

Also, Read

Please Rate Our Solution to Motivate Us For Give Our Best

Leave a Comment