@@ -24,7 +24,7 @@ public MySQL(String host, int port, String username, String password, String dat
2424 this .connect (host , port , username , password , database , attributes );
2525 } catch (SQLException e ) {
2626 if (e .getErrorCode () == 1049 ) {
27- createDatabase (host , port , username , password , database );
27+ createDatabase (host , port , username , password , database , attributes );
2828
2929 connect (host , port , username , password , database , attributes );
3030
@@ -59,8 +59,8 @@ private void connect(String host, int port, String username, String password, St
5959 this .connected = true ;
6060 }
6161
62- private void createDatabase (String host , int port , String username , String password , String database ) throws SQLException {
63- connection = DriverManager .getConnection ("jdbc:mysql://" + host + ":" + port + "?" , username , password );
62+ private void createDatabase (String host , int port , String username , String password , String database , String attributes ) throws SQLException {
63+ connection = DriverManager .getConnection ("jdbc:mysql://" + host + ":" + port + ( attributes . isEmpty () ? "" : "?" + attributes ) , username , password );
6464
6565 Statement statement = connection .createStatement ();
6666
0 commit comments