Connecting to remote MySQL

Hi there… New to xojo…

I am trying to modify the MySQLExample in order to connect to my remote MySQL server…
Here is what I tried…

mDb = New MySQLCommunityServer

mDb.Host = “”
mDb.UserName = “amaliatr_test”
mDb.Password = “00196.test”
mDb.DatabaseName = “amaliatr_test”

mIsConnected = True
ConnectStatusLabel.Text = “Connected to MySQL”
Catch e As DatabaseException
ConnectStatusLabel.Text = "Error connecting to MySQL: " + e.Message
End Try

It gives me error. it says Can’t connect to…

I also tried with the IP instead of the domain name. Same issue.

Naturally, I have already enabled my local IP on the RemoteMYSQL host list…
user, password and db are fine as I copied them from a PHP piece of code that works…

Any suggestions??


Maybe use the properties « port »

You need to specify the port unless you’re using the default port. For security purposes, I recommend using a different port. (But this doesn’t solve all the potential security issues - that’s another discussion.)

Have you tried connecting with MySQL Workbench? If the workbench connects, then the problem is with your application. If workbench doesn’t connect then the problem is likely with your server or firewall configuration.