VB.NET CANNOT Connect Remotely to a MariaDB (on Web Server)
I have downloaded the 'MySql.Data.dll' (version 8.0.15) and have the following set up to connect (remote access) to a MariaDB on my web server:
Imports MySql.Data.MySqlClient
Dim MysqlConn As MySqlConnection
Dim COMMAND As MySqlCommand
MysqlConn = New MySqlConnection
MysqlConn.ConnectionString = "server=198.27.87.232;userid=aaronest_aaron;password=Jordan123;database=aaronest_ekspdb"
MysqlConn.ConnectionString = "server=167.172.0.112;userid=root;password=Jordan123$;database=aaronest_ekspdb;port=3306;Sslmode=required"
Dim READER As MySqlDataReader
Try
MysqlConn.Open()
Dim Query As String
Query = "select * from table3 where FirstName='" & TextBox1.Text & "' and LastName='" & TextBox2.Text & "' and Email='" & TextBox3.Text & "' and SerialLicense='" & TextBox4.Text & "'"
COMMAND = New MySqlCommand(Query, MysqlConn)
READER = COMMAND.ExecuteReader
Dim count As Integer
count = 0
While READER.Read
count = count + 1
End While
MysqlConn.Close()
Catch ex As MySqlException
MsgBox(ex.Message)
Finally
MysqlConn.Dispose()
End Try
I have already imported the 'MySql.Data.dll', but it's still not able to connect to the remote web server mariaDB that I've created. The message that I keep receiving is:
"Unable to connect to any of the specified MySql hosts."
I have already opened up the ports and set the correct IP address to my server, but no matter what I do, it still keeps showing this message. I'm able to connect through Localhost when I'm on the web server and through MySQL Workbench, but not through my VB.NET application.
Any support would be greatly appreciated.