Remote Access to MySQL database of a website using VB.NET 2010 -
I am trying to add a vb.net2010 project to a database of a website. I have already added% as the host in the remote messaging access to the CPU, and my firewall is closed.
Here is the code I used:
MySQLconn MySQLconn as new MySqlConnection = New MySqlConnection ("server = www.mysite.net; user id = myusername ; Pwd = mypassword; database = mydatabase; port = 3306; ") Try MySQLconn.Open ()" Message "(" Sausage ", vbOKOnly) MySQLconn.Close An error has been caught Says "Unable to connect to any specified MySQL host"
I hope I can get help or suggestions.
Thank you.
Please verify that MySQL SQL Server listens on external interfaces.
In most Nix environments this is the default for the localhost, it means that you can not connect to a remote machine, even if you disable the firewall.
This is either
Tie-address xxxx
Where xxxx is the IP address of www.mysite.net and restart your MySQL server.
Update
As you are using cpanel, have you whitelisted the IP address here?
Actually there are three things to do:
- Whitelist as your IP or% wild card (you have already done it)
- Add firewall rule (it is not certain that if cpanel is necessary, you can confirm that with a port scanner
- your user has permission to access the database (
Permission ... current ... @% for the user
) with a remote host. If you run this command, you should get a password prompt mysql -h www.mysite.net -u user -p
. If you have an entry for user @% If the prohibition has been received, you need to allow the user @ your- ip-address-or-hostname.
Comments
Post a Comment