Skip to content

Minecraft MySQL JDBC

Up-to-date MySQL Connector/J wrapped as a universal Forge/Fabric/Bukkit library for plugins like Grim.

FabricNeoForgeForgeQuilt
Loaders
FabricNeoForgeForgeQuilt
Downloads on Modrinth
1.8K
Followers on Modrinth
0
versions
3
Updated
June 7, 2026Jun 7
Published
in 2026
This is a library — other mods need it, and it adds nothing to the game by itself

At a glance

A library: other mods need it
Runs on Fabric, NeoForge, Forge and Quilt
For Minecraft 1.12.2–26.1.2
Latest version — 9.7.0+2026-05-03 from June 7, 2026
License GPL-2.0-only — free
Where it's needed
In gameunknownOn serverunknown

The author didn't say where the mod is needed

Game versions1.12.2–26.1.2

MySQL Connector/J for Minecraft

Oracle's official MySQL Connector/J repackaged as a Bukkit/Spigot/Paper plugin and a Fabric/Forge/NeoForge mod.

Heads up: CraftBukkit/Spigot/Paper have shipped MySQL Connector/J on the server's parent classloader since 1.4 (the "ebeans" era). For the default JDBC path (Class.forName("com.mysql.cj.jdbc.Driver") / DriverManager.getConnection) the bundled driver wins — installing this mod doesn't change that. This mod is primarily useful on Fabric, NeoForge, and Bukkit forks that strip the bundled driver. If you specifically want this mod's connector instead of the bundled one (e.g. for a newer connector version), use the public API — see Using this mod's connector via the public API below.

What's in the jar

com.mysql:mysql-connector-j:9.1.0 plus minimal loader stubs for Spigot, Forge 1.12, Forge 1.13–1.16, Forge 1.17–1.20, NeoForge 1.21+, and Fabric. No relocation — com.mysql.cj.* classes stay at canonical paths so Class.forName("com.mysql.cj.jdbc.Driver") finds them. META-INF/services/java.sql.Driver is preserved so the driver auto-registers with DriverManager.

The mysql:mysql-connector-java → com.mysql:mysql-connector-j rename happened in connector-j 8.x. The class name com.mysql.cj.jdbc.Driver works across both old and new artifact coords, so the runtime probe is stable.

Compatibility

LoaderMC versionsNotes
Bukkit / Spigot / Paper / Folia / Purpur1.8 → currentusually unnecessary — driver is server-bundled
Fabric1.16.1 → currentneeds Fabric Loader 0.14+
Forge1.12 → 1.20universal jar, no Mixins
NeoForge1.21 → currentdrop into mods/

Java 8+ required.

Connection-string gotchas worth knowing

The 5.1.x and 8+ drivers default to behaviours that almost always need overriding for real deployments:

  • useSSL=true is the default — fails against any MySQL server without a public CA-signed cert. Set useSSL=false for plaintext, or add verifyServerCertificate=false if you have a self-signed cert.
  • caching_sha2_password (MySQL 8 default) needs allowPublicKeyRetrieval=true for unencrypted-channel auth, otherwise the handshake fails with Public Key Retrieval is not allowed.
  • rewriteBatchedStatements=true folds JDBC batch INSERTs into multi-row form on the wire. Without it, batch operations are still N round-trips.

Typical URL:

jdbc:mysql://host:3306/db?useSSL=false&allowPublicKeyRetrieval=true&rewriteBatchedStatements=true

MariaDB speaks the MySQL protocol on the wire, so this driver works against MariaDB too. If you want the MariaDB-native connector instead, it's a separate driver and not in scope here.

Versioning

The jar version tracks connector-j one-to-one. 9.1.0+2026-04-25 ships connector-j 9.1.0; the suffix is the build date. A scheduled GitHub Action checks Maven Central daily and bumps automatically.

Using this mod's connector via the public API

If you specifically want this mod's connector instead of the bundled one — to upgrade past a stale fork's bundled driver, or to test a newer connector version — your plugin softdepends on this holder and calls MinecraftMysqlJdbc.connect(url, props):

# in your plugin.yml
softdepend: [mysql-jdbc]
Properties props = new Properties();
props.setProperty("user", "grim");
props.setProperty("password", "...");
Connection c;
try {
    c = MinecraftMysqlJdbc.connect("jdbc:mysql://host:3306/db?useSSL=false", props);
} catch (NoClassDefFoundError | ClassNotFoundException notInstalled) {
    c = DriverManager.getConnection("jdbc:mysql://host:3306/db?useSSL=false", props);
}

MinecraftMysqlJdbc wraps a child-first URLClassLoader pointing at this jar, parented to the platform classloader so com.mysql.cj.* must come from this jar (not the bundled chain). The returned Connection is a standard java.sql.Connection — keep your casts to java.sql.* interfaces; the impl class lives in the child-first classloader and won't down-cast across the boundary.

API surface (all static):

MethodReturns
connect(String url)open Connection through this driver
connect(String url, Properties props)as above with props
driver()the java.sql.Driver instance
driverVersion()connector-j version (e.g. "9.1")
eagerInit()warm the classloader at plugin enable
shutdown()release file handles on plugin disable

Grim Anti-Cheat's MySQL backend uses this API automatically when this holder is installed.

License

GPL-2.0 with the Universal FOSS Exception 1.0. The exception makes the driver compatible with any FOSS-licensed Minecraft plugin or mod (it's the same license Oracle ships with the Connector/J binary). Modrinth's license tag shows GPL-2.0-only because the SPDX list doesn't have a single identifier for the GPL-2 + FOSS Exception combo — full text in LICENSE.


Issues, source: GitHub.

FAQ

How to install Minecraft MySQL JDBC?

Install Fabric for your Minecraft version, download Minecraft MySQL JDBC for the same version and loader, put the file into the mods folder and launch the game with the loader profile.

Which Minecraft versions does Minecraft MySQL JDBC support?

Minecraft MySQL JDBC has builds for Minecraft 1.12.2–26.1.2.

License and source
GNU General Public License v2.0 onlyfree to use and share; changes to the mod itself must be published under the same license
Original — Modrinth↗Files unchanged, verified with SHA-512Is this your mod? For rights holders

The site uses cookies: the necessary ones for sign-in and the theme, plus the Yandex Metrica and LiveInternet visit counters — they show us how the site is used. We have no advertising cookies. More