views:

185

answers:

2

I developed a project in VB.NET

In this project I want to use data from MySQL that is resides in my WEB Server.

I can communicate with the MySQL server of my localhost but can not communicate with the WEB Server.

In my CPanel I added Host from the Remote Database Access

But I can't communicate with WEB MySQL Server.

Please help me.

+1  A: 

Since your post indicates you can access the DB on your localhost, it doesn't seem to be an issue with the way you're connecting to the DB from your application (.NET-Connector?).

What does the external MySQL-Server say? Access denied? Or can't you reach it from the pc where your application is hosted (aka maybe a firewall regulation, other network etc.)?

Björn
It says that my user with the host and password is not permitted.
Tareq
Well, there's your problem! ;-) You have to give the user which is used by the application the right to access the DB. Pls read the referring article in the mysql manual for it for more details:http://dev.mysql.com/doc/refman/5.1/en/user-account-management.htmlBasically user@localhost can access only from localhost, user@* can access the db from everywhere.
Björn
I tried to user user@%But it fails.
Tareq
If you change the user settings on your server, don't forget to do a FLUSH PRIVILEGES afterwards (depending on how you changed the user settings). As long as your mysql server keeps saying "host and/or password not permitted", it is because the host from which you are trying to connect and/or the password which you are using just isn't correct.
Björn
But in CPanel how can I flush the privileges?????
Tareq
Sry, I don't know how 'CPanel' works. Maybe enter the SQL Syntax somewhere and execute it.
Björn
+2  A: 

The first step is to try to connect to the web mysql with MySql Query Browser - that will tell you if the database is open for remote connections ( I assume it would fail)

I guess you have already checked it, but make sure you use the correct ip

EDIT:

As Björn said, your vb code is ok, so the problem is with the connection to the db.

Unfortunately that would be caused by many many reasons.

  • Are you sure you use a real IP from the host (and use it in the mysql settings)?
  • Are you sure you entered the correct remote host in the mysql settigns?
  • Are you sure you have correct connection string in the vb code?
Svetlozar Angelov
I want to establish a remote connection to my MySQL of the WEB Server. Please tell me how can I do that?
Tareq
The answers of all your questions are YES.
Tareq