for me it looks like you didn’t gain access to the user openhab on the server. Do you have phpMyAdmin setup? There you can configure access rights easily.
Mysql/MariaDB has a privilege system, that allows to restrict/gain access to each database for each user and even link it to dedicated hosts.
Last but not least keep in mind IPv6, sometimes it tricks you if the sql server is reachable via IPv4 AND v6. - In this case I suspect it is not an issue because you give the server address in v4 (and not the host name.)
Thanks for the advise.
The user openhab (on the database server) has rights on the openhab database.
But the log says "Access denied for user ‘openhab’@‘xxx.xxx.xxx.160’ "
This refers to the user openhab on the openhab server , not the DB user openhab on the database server if i’m correct.
Mysql permissions are host based. So you can allow a mysql user to login from some host but deny it from others. Allow from any IP as @elite recommends may be an option, but if your OH server has a static IP it would be more secure to restrict incoming database connections from all others.