mirror of
https://github.com/LuckPerms/LuckPerms.git
synced 2024-11-28 13:45:20 +01:00
Set default port
This commit is contained in:
parent
4857969ca4
commit
b4b661a3ad
@ -54,17 +54,21 @@ public class MySQLBacking extends SQLBacking {
|
|||||||
public void init() {
|
public void init() {
|
||||||
HikariConfig config = new HikariConfig();
|
HikariConfig config = new HikariConfig();
|
||||||
|
|
||||||
final String address = configuration.getAddress();
|
String address = configuration.getAddress();
|
||||||
final String database = configuration.getDatabase();
|
String[] addressSplit = address.split(":");
|
||||||
final String username = configuration.getUsername();
|
address = addressSplit[0];
|
||||||
final String password = configuration.getPassword();
|
String port = addressSplit.length > 1 ? addressSplit[1] : "3306";
|
||||||
|
|
||||||
|
String database = configuration.getDatabase();
|
||||||
|
String username = configuration.getUsername();
|
||||||
|
String password = configuration.getPassword();
|
||||||
|
|
||||||
config.setMaximumPoolSize(configuration.getPoolSize());
|
config.setMaximumPoolSize(configuration.getPoolSize());
|
||||||
|
|
||||||
config.setPoolName("luckperms");
|
config.setPoolName("luckperms");
|
||||||
config.setDataSourceClassName("com.mysql.jdbc.jdbc2.optional.MysqlDataSource");
|
config.setDataSourceClassName("com.mysql.jdbc.jdbc2.optional.MysqlDataSource");
|
||||||
config.addDataSourceProperty("serverName", address.split(":")[0]);
|
config.addDataSourceProperty("serverName", address);
|
||||||
config.addDataSourceProperty("port", address.split(":")[1]);
|
config.addDataSourceProperty("port", port);
|
||||||
config.addDataSourceProperty("databaseName", database);
|
config.addDataSourceProperty("databaseName", database);
|
||||||
config.addDataSourceProperty("user", username);
|
config.addDataSourceProperty("user", username);
|
||||||
config.addDataSourceProperty("password", password);
|
config.addDataSourceProperty("password", password);
|
||||||
|
Loading…
Reference in New Issue
Block a user