954,517 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Connection to a remote MySQL database

Hi,

I'm trying to make a rather simple Visual Basic app with which I can update some tables within my MySQL databases.

I've been following this tutorial from page 3 on, as the first 2 pages where on how to initialize a local MySQL database.

My MySQL database is on my website, so I thought I had to use the website's name instead of "localhost".

Anyways, I now use this code:

Dim connection As MySqlConnection
connection = New MySqlConnection()

connection.ConnectionString = "Server=resload.com; Uid=***; Pwd=***; Database=***;"

Try
    connection.Open()
    MessageBox.Show("Connection Opened Successfully")
    connection.Close()
Catch mysql_error As MySqlException
    MessageBox.Show("Error Connecting to Database: " & mysql_error.Message)
Finally
    connection.Dispose()
End Try


But it popups (don't now whether that's a real word :p) with the message:Error Connecting to Database: Access denied for user '***'@'my ipaddress' (using password: YES)

I've spent a lot of hours searching for the solution and problem, but couldn't find a working answer. My question therefore is; do you know what is going wrong?

Greetz,

Ragoune

Ragoune
Newbie Poster
16 posts since Jul 2009
Reputation Points: 57
Solved Threads: 0
 

Hi
I've more experience with Microsoft SQL server but to me it looks like you are finding the database but don't have the rights to access.

Try pointing the server entry to somewhere that can't / doesn't exist do you get a different message? If so, that means you were getting to the DB it's just not letting you in...

G_Waddell
Posting Whiz in Training
255 posts since Nov 2009
Reputation Points: 43
Solved Threads: 27
 

I'm getting the same error when I select a database which doesn't exist. And what's Microsoft SQL server exactly?

Ragoune
Newbie Poster
16 posts since Jul 2009
Reputation Points: 57
Solved Threads: 0
 

If you are using a MYSQL from your hosting like yahoo.smallbusiness. It wont be possible or at least it wont be easy. You will need to build some web interface to interact with your application i.e. xml.

pabloh007
Newbie Poster
17 posts since Jun 2010
Reputation Points: 10
Solved Threads: 2
 

Thank you for your help. I've found the solution: follow these steps and it'll work:

Go to your webpages admin panel.
Click on MySQL management.
Click on the database to which you want to connect with your application.
Below you will see table named "Access Hosts". Here you only have to add the IP address from which the application is working.
You application will connect!

Ragoune
Newbie Poster
16 posts since Jul 2009
Reputation Points: 57
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: