Back to all posts

MySQL Connector/J: mysql-connector-j vs mysql-connector-java

For Java developers whose Maven or Gradle build uses the MySQL JDBC driver. You know what a dependency block is; Spring Boot builds are covered too.

On this page

Your build declares mysql:mysql-connector-java, and a newer project uses com.mysql:mysql-connector-j. Both are MySQL Connector/J, the JDBC driver for MySQL. Oracle changed its Maven coordinates in release 8.0.31. The old coordinates have no jar after 8.0.30 and no version after 8.0.33. Use the new coordinates:

<dependency>
    <groupId>com.mysql</groupId>
    <artifactId>mysql-connector-j</artifactId>
    <version>26.10.0</version>
</dependency>

Maven Central holds these versions under each name, checked on 12 November 2026:

CoordinatesVersionsWhat each version holds
mysql:mysql-connector-javaup to 8.0.30The driver jar
mysql:mysql-connector-java8.0.31 to 8.0.33A POM that points to the new coordinates, and no jar
com.mysql:mysql-connector-j8.0.31 to 26.10.0The driver jar

Why the coordinates changed in 8.0.31

The Connector/J 8.0.31 release notes give the reason as "proper naming guidelines". Maven's naming conventions ask for a groupId that starts with a reversed domain name. mysql is not one, and com.mysql is. The jar file was renamed to mysql-connector-j-x.y.z.jar in every download channel, not only on Maven.

For 8.0.31 to 8.0.33, the old coordinates hold only a relocation POM. Here is the POM of version 8.0.33 from Maven Central, without its licence comment and namespace attributes:

<project>
  <modelVersion>4.0.0</modelVersion>

  <groupId>mysql</groupId>
  <artifactId>mysql-connector-java</artifactId>
  <version>8.0.33</version>

  <distributionManagement>
    <relocation>
      <groupId>com.mysql</groupId>
      <artifactId>mysql-connector-j</artifactId>
      <message>MySQL Connector/J artifacts moved to reverse-DNS compliant Maven 2+ coordinates.</message>
    </relocation>
  </distributionManagement>
</project>

Maven follows a relocation to the new coordinates and prints a warning, according to the Maven guide to relocation. A dependency on mysql:mysql-connector-java:8.0.33 therefore still builds. Maven downloads the jar of com.mysql:mysql-connector-j:8.0.33 in its place.

To move to a later version, change the groupId and the artifactId, not only the version. The old coordinates have no version after 8.0.33, so Maven can't find mysql:mysql-connector-java:9.0.0 or any later one.

Maven and Gradle dependency for MySQL Connector/J

The Maven block is the one at the top of this page, with the coordinates from the Connector/J Maven guide. In Gradle, the same coordinates go on one line:

runtimeOnly 'com.mysql:mysql-connector-j:26.10.0'

Use runtimeOnly when your code reaches the driver only through java.sql. If your code imports com.mysql classes, use implementation.

Connector/J also implements the X DevAPI, MySQL's second API beside JDBC. The X DevAPI needs protobuf-java, so Maven and Gradle download it as a transitive dependency: Connector/J 26.10.0 depends on protobuf-java 4.36.1. If you use only JDBC, exclude protobuf-java, as the Maven guide shows:

<dependency>
    <groupId>com.mysql</groupId>
    <artifactId>mysql-connector-j</artifactId>
    <version>26.10.0</version>
    <exclusions>
        <exclusion>
            <groupId>com.google.protobuf</groupId>
            <artifactId>protobuf-java</artifactId>
        </exclusion>
    </exclusions>
</dependency>

Why Spring Boot says the dependency version is missing

A project whose parent is spring-boot-starter-parent usually leaves out the driver's version, because Spring Boot manages it. Spring Boot 2.7.8 and 3.0.3 stopped managing mysql:mysql-connector-java. In those releases and later ones, this dependency has no version:

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

With Spring Boot 3.5.0 as the parent, mvn validate fails with:

[ERROR] 'dependencies.dependency.version' for mysql:mysql-connector-java:jar is missing. @ line 12, column 21

Change the groupId to com.mysql and the artifactId to mysql-connector-j, still without a version, and the same build succeeds. Spring Boot sets the version in its mysql.version property: 9.2.0 in Spring Boot 3.5.0, and 9.5.0 in 4.0.0.

Which Connector/J version to use with your MySQL server

Oracle publishes one Connector/J release at a time, and each new release replaces the one before it. Its release notes say which MySQL Server versions it supports. Since July 2026, MySQL numbers its releases by the calendar, as YY.M.P, says the MySQL 26.7 Reference Manual. Connector/J uses the same numbers, so after 9.7.0 came 26.7.0, the July 2026 release, and then 26.10.0.

ReleaseReleasedMySQL Server it supports
26.10.02026-10-218.4 and later
9.7.02026-04-228.0 and later

The dates and server ranges come from the 26.10.0 and 9.7.0 release notes. On MySQL 8.4 or later, use the latest release, whatever the server's own version number. On MySQL 8.0, use 9.7.0: it is the newest release whose notes name 8.0.

Connector/J 26.10 runs on JRE 8 or higher and implements JDBC 4.2, according to its compatibility page.

How to upgrade from Connector/J 5.1

Connector/J 5.1 is the release line before 8.0. Its last version is 5.1.49, under mysql:mysql-connector-java. Besides the dependency, check your code against Oracle's upgrade guide from 5.1. It lists the connection properties, API methods, build properties and exceptions that changed.

The driver class changed too, and the article on com.mysql.cj.jdbc.Driver vs com.mysql.jdbc.Driver covers it. For the current connection properties, see MySQL JDBC URL parameters. If the first connection to MySQL 8.0 or later fails with "Public Key Retrieval is not allowed", see the fix for that error.

How to check which Connector/J version is loaded

Check the build first: mvn dependency:tree or gradle dependencies lists the resolved coordinates and version. Then check the jar that your application loads. A second Connector/J jar on the classpath can be loaded in place of the one in your build file. The jar's manifest records the version:

unzip -p mysql-connector-j-26.10.0.jar META-INF/MANIFEST.MF | grep Implementation-Version
Implementation-Version: 26.10.0

At run time, the driver reports its version through the connection's metadata. Put your own host and password in the URL:

import java.sql.Connection;
import java.sql.DatabaseMetaData;
import java.sql.DriverManager;

public class CheckDriver {
    public static void main(String[] args) throws Exception {
        try (Connection c = DriverManager.getConnection("jdbc:mysql://localhost:3306/", "root", "your-password")) {
            DatabaseMetaData md = c.getMetaData();
            System.out.println(md.getDriverName() + " " + md.getDriverVersion());
        }
    }
}

Run with java -cp mysql-connector-j-26.10.0.jar CheckDriver.java against MySQL 9.1.0, it printed:

MySQL Connector/J mysql-connector-j-26.10.0 (Revision: fac9201148ebe3f84a5754cb86ebbacaf1cdce7f)

The classpath of this run held no protobuf-java, and the JDBC connection worked. If the printed version differs from your build file, remove any mysql:mysql-connector-java dependency and check the dependency tree again.

How DbSchema downloads the MySQL JDBC driver for you

DbSchema downloads Connector/J the first time you connect to MySQL, so you never handle the jar. Choose File → New Model, pick MySql, choose New Connection, and press the Connect button. The JDBC Driver field of the connection dialog shows the jar that DbSchema uses.

The DbSchema Connect to MySQL dialog, with a downloaded jar, mysql-connector-j-26.7.0.jar, in the JDBC Driver field

DbSchema keeps the driver in its own drivers folder, apart from your project's classpath. On 12 November 2026, the MySql drivers folder of DbSchema on a Windows computer held mysql-connector-j-26.10.0.jar and protobuf-java-4.36.1.jar.

Upload your own Connector/J jar

If DbSchema can't download the driver, or your team uses one specific driver build, upload the jar in the JDBC Drivers Manager:

  1. Choose Database → Manage → JDBC Drivers Manager. The wrench button next to JDBC Driver in the connection dialog opens it too.
  2. Pick MySql in the Database list.
  3. Press Upload Driver Jar(s) and choose the jar.

To go back to the driver that DbSchema hosts, press Download from dbschema.com in the same window.

To watch the steps, see the video MySQL JDBC Driver: Download, Configure and See Your Database as an ER Diagram.

Download DbSchema and connect to your MySQL server. The free Community Edition downloads Connector/J on the first connection, or uses the jar you upload.

Connect to MySQL without managing the driver

DbSchema downloads MySQL Connector/J on your first connection, takes your team's own jar in the JDBC Drivers Manager, and reverse-engineers the schema into diagrams in the free Community Edition.