It's possible that my database doesn't connect. I ...
# exposed
d
It's possible that my database doesn't connect. I just went into my database and it doesn't seem that it created anything:
Copy code
val dataSource = HikariDataSource().apply {
        maximumPoolSize = 20
        driverClassName = "com.mysql.jdbc.Driver"
        jdbcUrl = File("jdbc_url.txt").readText()
        isAutoCommit = false
    }

    Database.Companion.connect(dataSource)

    transaction {
        SchemaUtils.create(MediaPropertiesTable)
        SchemaUtils.create(MediaContentTable)
        SchemaUtils.create(UserAPIKeysTable)
        SchemaUtils.create(UserTable)
    }
The file jdbc_url.txt does exist and has a connection url generated from pterodactyl UPDATE: Tried removing pterodactyl from the equation and still doesnt work. It gets past the create code and all, nothing gets logged even after adding
addLogger(StdOutSqlLogger)
and the tables arent in the db.
1
b
maybe the problem is in
autoCommit = false
, try like this:
Copy code
transaction { 
  // create 
  commit () 
}
the query is displayed in the log?
jdbc_url.txt
- are you sure the URL is correct?
Also, first create a HikariConfig, and already from it we get a HikariDataSource. True, I am not too familiar with Hikari
t
@Dominick , can you connect to database without the HikariDataSource? Also I can't see that you provide username/password, are they in jdbc_url?
d
I've solved the problem, in the end I think it was the jdbc url & the connector, I switched to a mysql jdbc url and specifying the username & password with addDataSourceProperty, and ensuring the connector I depended on was mysql-connector-java, even though it's a mariadb.