Use MariaDB JDBC URL for connections.
This commit is contained in:
@@ -1369,7 +1369,7 @@ public final class Config
|
||||
GAME_SERVER_LOGIN_HOST = serverSettings.getProperty("LoginHost", "127.0.0.1");
|
||||
|
||||
DATABASE_DRIVER = serverSettings.getProperty("Driver", "org.mariadb.jdbc.Driver");
|
||||
DATABASE_URL = serverSettings.getProperty("URL", "jdbc:mysql://localhost/");
|
||||
DATABASE_URL = serverSettings.getProperty("URL", "jdbc:mariadb://localhost/");
|
||||
|
||||
DATABASE_LOGIN = serverSettings.getProperty("Login", "root");
|
||||
DATABASE_PASSWORD = serverSettings.getProperty("Password", "");
|
||||
@@ -3822,7 +3822,7 @@ public final class Config
|
||||
EXTERNAL_HOSTNAME = serverSettings.getProperty("ExternalHostname", "localhost");
|
||||
|
||||
DATABASE_DRIVER = serverSettings.getProperty("Driver", "org.mariadb.jdbc.Driver");
|
||||
DATABASE_URL = serverSettings.getProperty("URL", "jdbc:mysql://localhost/l2jdb");
|
||||
DATABASE_URL = serverSettings.getProperty("URL", "jdbc:mariadb://localhost/l2jdb");
|
||||
DATABASE_LOGIN = serverSettings.getProperty("Login", "root");
|
||||
DATABASE_PASSWORD = serverSettings.getProperty("Password", "");
|
||||
DATABASE_MAX_CONNECTIONS = Integer.parseInt(serverSettings.getProperty("MaximumDbConnections", "10"));
|
||||
|
@@ -72,7 +72,7 @@ public class DatabaseBackup
|
||||
final String mysqldumpPath = System.getProperty("os.name").toLowerCase().indexOf("win") >= 0 ? Config.MYSQL_BIN_PATH : "";
|
||||
try
|
||||
{
|
||||
final Process process = Runtime.getRuntime().exec(mysqldumpPath + "mysqldump -u " + Config.DATABASE_LOGIN + (Config.DATABASE_PASSWORD.trim().isEmpty() ? "" : " -p" + Config.DATABASE_PASSWORD) + " " + Config.DATABASE_URL.replace("jdbc:mysql://", "").replaceAll(".*\\/|\\?.*", "") + " -r " + Config.BACKUP_PATH + (Server.serverMode == Server.MODE_GAMESERVER ? "game" : "login") + new SimpleDateFormat("_yyyy_MM_dd_HH_mm'.sql'").format(new Date()));
|
||||
final Process process = Runtime.getRuntime().exec(mysqldumpPath + "mysqldump -u " + Config.DATABASE_LOGIN + (Config.DATABASE_PASSWORD.trim().isEmpty() ? "" : " -p" + Config.DATABASE_PASSWORD) + " " + Config.DATABASE_URL.replace("jdbc:mariadb://", "").replaceAll(".*\\/|\\?.*", "") + " -r " + Config.BACKUP_PATH + (Server.serverMode == Server.MODE_GAMESERVER ? "game" : "login") + new SimpleDateFormat("_yyyy_MM_dd_HH_mm'.sql'").format(new Date()));
|
||||
process.waitFor();
|
||||
}
|
||||
catch (Exception e)
|
||||
|
@@ -36,7 +36,7 @@ public class MySqlConnect
|
||||
try (Formatter form = new Formatter())
|
||||
{
|
||||
Class.forName("org.mariadb.jdbc.Driver").newInstance();
|
||||
final String formattedText = form.format("jdbc:mysql://%1$s:%2$s", host, port).toString();
|
||||
final String formattedText = form.format("jdbc:mariadb://%1$s:%2$s", host, port).toString();
|
||||
con = DriverManager.getConnection(formattedText, user, password);
|
||||
|
||||
try (Statement s = con.createStatement())
|
||||
|
Reference in New Issue
Block a user