Hello friends,
I want to create a connection between mysql remote server and asp.net
Where database server information is as follows
- Server: Localhost via UNIX socket
- Server type: MySQL
- Server version: 5.7.26-0ubuntu0.16.04.1 - (Ubuntu)
- Protocol version: 10
- User: root@localhost
- Server charset: UTF-8 Unicode (utf8)
In code behind on page load
Dim str As String = ConfigurationManager.ConnectionStrings("rtd").ConnectionString
Dim conn As MySqlConnection = New MySqlConnection(str)
Dim cmd As MySqlCommand = New MySqlCommand("SELECT * FROM realtime order by id desc limit 1")
Dim da As MySqlDataAdapter = New MySqlDataAdapter()
cmd.Connection = conn
da.SelectCommand = cmd
Dim dt As DataTable = New DataTable()
da.Fill(dt)
rtgrid.DataSource = dt
rtgrid.DataBind()
SocketException: A connection attempt failed because the connected party did not properly respond after a period
of time, or established connection failed because connected host has failed to respond
can anyone suggest me where I am wrong?
Tuman SahuPosted Feb 13, 2020, 4:22 AM
Guest UserPosted Feb 12, 2020, 2:36 AM