[SOLVED] MySQL no connection with OpenHAB in docker


My Openhab 2.5 is running in a Docker on a Debian server.
MariaDB runs directly on the Server.

My Docker Openhab can’t connect to SQL, but a local installed Openhab can connect with the same jdbc.cfg




Log Error:

2019-10-10 05:48:57.225 [WARN ] [jdbc.internal.JdbcPersistenceService] - JDBC::store: No connection to database. Cannot persist item ‘SensorSZLUMI_Humidity (Type=NumberItem, State=38.16)’! Will retry connecting to database when error count:0 equals errReconnectThreshold:3

SQL binding address is
SQL User = smarthome@% with all rights for DB

So how can i find the error?


So this is a Docker configuration issue better solved in a Docker forum.

Are you running OH with the --net=host option? It might not have network access to the host otherwise.

Thanks, sure as host.
Today i have changed OpenHAB Docker from snapshot to milestone and reinstalled MariaDB.
A little change in jdbc.cfg: url=jdbc:mariadb:// to url=jdbc:mysql://
and a newer mysql-connector-java.jar
and it works now :grinning: