mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2025-01-29 19:41:35 +01:00
Added config setting to bungee & bukkit for custom MySQL launch options #452
This commit is contained in:
parent
90c448afe5
commit
007ee97699
@ -1,5 +1,6 @@
|
||||
package main.java.com.djrapitops.plan.database.databases;
|
||||
|
||||
import com.djrapitops.plugin.api.utility.log.Log;
|
||||
import main.java.com.djrapitops.plan.api.IPlan;
|
||||
import main.java.com.djrapitops.plan.api.exceptions.DatabaseInitException;
|
||||
import main.java.com.djrapitops.plan.settings.Settings;
|
||||
@ -35,8 +36,13 @@ public class MySQLDB extends SQLDB {
|
||||
String host = Settings.DB_HOST.toString();
|
||||
String port = Integer.toString(Settings.DB_PORT.getNumber());
|
||||
String database = Settings.DB_DATABASE.toString();
|
||||
String launchOptions = Settings.DB_LAUNCH_OPTIONS.toString();
|
||||
if (launchOptions.isEmpty() || !launchOptions.startsWith("?") || launchOptions.endsWith("&")) {
|
||||
Log.error("Launch Options were faulty, using default (?rewriteBatchedStatements=true&useSSL=false)");
|
||||
launchOptions = "?rewriteBatchedStatements=true&useSSL=false";
|
||||
}
|
||||
|
||||
dataSource.setUrl("jdbc:mysql://" + host + ":" + port + "/" + database + "?rewriteBatchedStatements=true&useSSL=false");
|
||||
dataSource.setUrl("jdbc:mysql://" + host + ":" + port + "/" + database + launchOptions);
|
||||
|
||||
String username = Settings.DB_USER.toString();
|
||||
String password = Settings.DB_PASS.toString();
|
||||
|
@ -49,6 +49,7 @@ public enum Settings {
|
||||
DB_USER("Database.MySQL.User"),
|
||||
DB_PASS("Database.MySQL.Password"),
|
||||
DB_DATABASE("Database.MySQL.Database"),
|
||||
DB_LAUNCH_OPTIONS("Database.MySQL.LaunchOptions"),
|
||||
LOCALE("Plugin.Locale"),
|
||||
WEBSERVER_IP("WebServer.InternalIP"),
|
||||
ANALYSIS_EXPORT_PATH("Analysis.Export.DestinationFolder"),
|
||||
|
@ -34,6 +34,8 @@ Database:
|
||||
User: root
|
||||
Password: minecraft
|
||||
Database: Plan
|
||||
# Launch options to append after driver address, for example
|
||||
LaunchOptions: "?rewriteBatchedStatements=true&useSSL=false"
|
||||
# -----------------------------------------------------
|
||||
Commands:
|
||||
AlternativeIP:
|
||||
|
@ -48,6 +48,8 @@ Database:
|
||||
User: root
|
||||
Password: minecraft
|
||||
Database: Plan
|
||||
# Launch options to append after driver address, for example
|
||||
LaunchOptions: "?rewriteBatchedStatements=true&useSSL=false"
|
||||
# -----------------------------------------------------
|
||||
Commands:
|
||||
AlternativeIP:
|
||||
|
Loading…
Reference in New Issue
Block a user