Hi
i have install OpenHAB in a Container with :
openhab:
restart: always
container_name: OpenHab
privileged: true
image: openhab/openhab:2.2.0-amd64-debian
depends_on:
- "portainer"
- "mysql"
volumes:
- "/etc/localtime:/etc/localtime:ro"
- "/etc/timezone:/etc/timezone:ro"
- "./openhab/addons:/openhab/addons"
- "./openhab/conf:/openhab/conf"
- "./openhab/userdata:/openhab/userdata"
tty: true
expose:
- "8080"
ports:
- "8080:8080"
environment:
OPENHAB_HTTP_PORT: "8080"
OPENHAB_HTTPS_PORT: "8443"
networks:
- openhab-network
and Mysql in :
mysql:
restart: always
container_name: Mysql
privileged: true
image: mysql
depends_on:
- "samba"
volumes:
- ./mysql/data:/var/lib/mysql
expose:
- "3306"
- "33060"
ports:
- "3306:3306"
- "33060:33060"
environment:
- MYSQL_ROOT_PASSWORD=Geheim
networks:
- openhab-network
I have Create the Datebase and the User maual
I User this Comand for the Service :
# the database url like 'jdbc:mysql://<host>:<port>/<database>' (without quotes)
url=jdbc:mysql://172.19.0.2:3306/OpenHAB
# the database user
user=openhab
# the database password
password=openhab
# the reconnection counter
#reconnectCnt=
# the connection timeout (in seconds)
#waitTimeout=
# Use MySQL Server time to store item values (=false) or use openHAB Server time (=true).
# For new installations, its recommend to set "localtime=true".
# (optional, defaults to false)
#localtime=true
IP = 172.19.0.2 is the IP from MySQL Container
The Logs :
[ERROR] [sql.internal.MysqlPersistenceService] - mySQL: Failed connecting to the SQL database using: driverClass=com.mysql.jdbc.Driver, url=jdbc:mysql://172.19.0.2:3306/OpenHAB, user=openhab, password=openhab
java.sql.SQLException: Access denied for user 'openhab'@'172.19.0.3' (using password: YES)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1078) [229:org.openhab.persistence.mysql:1.11.0]
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4190) [229:org.openhab.persistence.mysql:1.11.0]
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4122) [229:org.openhab.persistence.mysql:1.11.0]
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:927) [229:org.openhab.persistence.mysql:1.11.0]
IP = 172.19.0.3 is the IP from OpenHAB Container
Can anyone Help me Plz