Did you create the Database? I case you did not, do the following and/or follow this tutorial openHAB2 & MySQL persistence setup
While we are at it… maybe consider using InfluxDB instead of MySQL because this => InfluxDB+Grafana persistence and graphing
- Use the normal shell/terminal not openhab-karaf
- Fire up this command to login into your mysql server
mysql -h localhost -uroot -proot
- Fire up this command to list all databases
mysql> show databases;
(Note that "mysql> is the prompt from the shell) - Check if there is an openhab database, should look something like this
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| openhab |
| performance_schema |
+--------------------+
- If there is no openhab entry, create a Database with this command
CREATE DATABASE openhab;