Minecraft MySQL JDBC Mod provides an up-to-date MySQL Connector/J driver wrapped as a universal library for servers. This mod helps other mods and plugins, such as Grim Anti-Cheat, connect to external MySQL or MariaDB databases. It is most useful on Fabric, NeoForge, and custom Bukkit forks that remove the default bundled database driver.

Minecraft MySQL JDBC Mod

Features:

  • Universal Database Library: Packages Oracle’s official MySQL Connector/J (version 9.1.0) into a single jar file that works across Fabric, Forge, NeoForge, and Bukkit-based servers.
  • Standard Class Paths: Keeps all com.mysql.cj.* classes in their original locations without relocation so standard database calls find the driver right away.
  • Public API Bypass: Includes a dedicated MinecraftMysqlJdbc class with a child-first classloader so plugins can use this newer driver instead of older server-bundled ones.
  • Auto-registers with DriverManager by keeping the standard Java SQL driver service files intact.
  • Works with MariaDB servers since MariaDB uses the MySQL wire protocol.
  • Connects automatically with Grim Anti-Cheat’s MySQL backend when installed on the server.

Public API Methods:

  • connect(String url): Opens a standard SQL connection through this driver.
  • connect(String url, Properties props): Opens a connection using custom user and password properties.
  • driver(): Returns the active java.sql.Driver instance.
  • driverVersion(): Returns the current connector-j version string, such as "9.1".
  • eagerInit(): Warms up the classloader when a plugin starts.
  • shutdown(): Releases open file handles when a plugin turns off.

Configuration:

  • useSSL=false: Turns off SSL for plain text connections when your MySQL server does not have a public CA-signed certificate.
  • verifyServerCertificate=false: Lets you connect using a self-signed SSL certificate without failing the check.
  • allowPublicKeyRetrieval=true: Allows unencrypted authentication with MySQL 8’s default caching_sha2_password system.
  • rewriteBatchedStatements=true: Combines batch insert queries into multi-row statements to speed up database traffic.
jdbc:mysql://host:3306/db?useSSL=false&allowPublicKeyRetrieval=true&rewriteBatchedStatements=true
# 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);
}

Minecraft MySQL JDBC Mod Download Links

Filter by

For Minecraft 26.3, 26.2, 26.1.2

Forge, Fabric, NeoForge 3 MB

Click to rate this post!
[Total: 0 Average: 0]