I have the same issue here and don't know how to do. I use the service Azure Database for MySQL server.
My database is only on a private network.
I created a user and when I try to connect with it using the format username@servername, Keycloak (I use it for authentication), is giving me a NO with something unusual, the format username@IP. But the IP that is giving to me is not the IP address of the server !
The IP address of the server : 10.22.0.39
The IP I have : 10.22.0.42
I already checked, this IP don't exist at all.
I don't understand from where this IP come from and I tried everything I can, nothing is working.
The strange thing is that I can connect with MySQL Workbench using this specific user. It's really using Keycloak that I have this resolving of my server name to the IP 10.22.0.39.
I put here the server name : ex-integration-db1
Hope there is nothing to do with characters or anything linked to it.
Any help would be appreciated.