Switching from MySQL Persistence to JDBC Persistence MySQL

I started having issues with MySQL Persistence (not creating tables with string data). I decided to switch to the JDBC, if for no other reason than that it can use more meaningful table names.

I removed MySQL persistence, and when I try to install JDBC Persistence MySQL I I get this error in the log:

2019-10-27 13:39:04.670 [ERROR] [core.karaf.internal.FeatureInstaller] - Failed installing 'openhab-persistence-jdbc-mysql': Error:
	Error downloading mvn:mysql/mysql-connector-java/8.0.13
	Error downloading mvn:org.openhab.persistence/org.openhab.persistence.jdbc/1.14.0.M3

I’ve been trying to “downrev” to the 2.4.0 release but the windows update script fails (Can’t run the new update.ps1

Any suggestions welcome (except to not use Windows :slight_smile: )

I tried installing the JDBC MySql on a clean install of 2.4.0. I created a new database in mysql, and granted permissions to the hab user. I’m now getting a long stacktrace in the log, starting with:

2019-10-27 16:58:16.900 [INFO ] [persistence.jdbc.internal.JdbcMapper] - JDBC::openConnection: Driver is available::Yank setupDataSource
2019-10-27 16:58:18.087 [ERROR] [org.openhab.persistence.jdbc        ] - bundle org.openhab.persistence.jdbc:1.13.0 (215)[org.openhab.persistence.jdbc(225)] : The activate method has thrown an exception
com.zaxxer.hikari.pool.HikariPool$PoolInitializationException: Failed to initialize pool: Could not create connection to database server.

My jbdc.config has url=jdbc:mysql://<myhost>:3306/openhab2 in it, along with the username and password settings for the user. I can connect from mysql workbench using that url with those credentials. I don’t know a way to test the jdbc connection string outside openhab.

MySql is running on the same machine, as a windows service. I placed the file mysql-connector-java-8.0.13.jar in the addons folder.

I’m left wondering if there’s really a connection problem, or if I’ve missed an installation or configuration step.