Compatibility
Minecraft: Java Edition
Platforms
Supported environments
75% of ad revenue goes to creators
Support creators and Modrinth ad-free with Modrinth+Links
Creators
Details
JSMySQLFix
Description: JSMySQLFix is an innovative plugin designed for the Velocity proxy environment that ensures seamless MySQL database connectivity by automatically downloading and embedding the MySQL JDBC drivers. This plugin aims to simplify dependencies for server administrators and address potential issues caused by missing or incorrect drivers.
Features:
- Automatic Download: The plugin checks if the required MySQL JDBC driver is present. If not, it automatically downloads the driver from a secure source and saves it in the data directory.
- SHA-256 Verification: After the download, a SHA-256 verification is performed to ensure the integrity of the downloaded file, ensuring that the driver is unchanged and secure.
- Easy Embedding: Upon successful download, the MySQL driver is directly embedded into the application's classpath, allowing immediate use of MySQL functions.
- Logging: To facilitate maintenance, the plugin offers comprehensive logging capabilities that detail both successful downloads and any potential errors.
Accessing MySQL: Once the JSMySQLFix plugin is installed and the MySQL driver is successfully embedded, other plugins can access MySQL instantly. Developers can utilize standard JDBC connections to interact with their MySQL databases using the following connection string format:
String ip = "yourIP";
String port = "3306";
String databaseName = "yourDatabase";
String url = "jdbc:mysql://" + ip + ":" + port + "/" + databaseName + "?useSSL=false&allowPublicKeyRetrieval=true";
String username = "yourUsername";
String password = "yourPassword";
try {
Class.forName("com.mysql.cj.jdbc.Driver");
logger.info("Attempting to connect to database.);
connection = DriverManager.getConnection(url, username, password);
logger.info("Connected to the database.");
} catch (ClassNotFoundException e) {
logger.error("MySQL Driver not found: " + e.getMessage());
} catch (SQLException e) {
logger.error("Error while connecting to the database: " + e.getMessage());
}
Ensure to replace <yourIP>
, <port>
, <yourDatabase>
, <yourUsername>
, and <yourPassword>
with your actual MySQL server details.
Installation:
- Download the plugin and place it in the
/plugins
directory of your Velocity proxy. - Restart the proxy. The plugin will automatically download and embed the necessary MySQL drivers.
- Check the logs to confirm that everything has been installed correctly.