You need to open an ssh tunnel from your knowage server. If your knowage server is running in windows, you can do this using bash or putty, otherwise, you can use a linux terminal to run this command
ssh -o ServerAliveInterval=240 -N -L 3307:127.0.0.1:3306 username@{host or ip address} -p {ssh_port}
ServerAliveInterval=240 allows your SSH connection to keep alive, otherwise, it will automatically disconnect after a few minutes
You also have to forward your db to a different port, in my case, I use 3307
No need to define ssh port if it's port 22 (default)
Then in you knowage data source URL
jdbc:mysql://localhost:3307/{database_name}
Take note, it has to be localhost in your data source.