Makara Set
Makara Set

Reputation: 371

How to insert data to Mysql database hosting using vb.net

I have a website using PHP and MySQL Database that hosting ready. I want to upload data to website by using windows application using VB.net but I cannot connect to database. I try this code to connect to Mysql database:

    Dim conn As MySqlConnection
    conn = New MySqlConnection()
    conn.ConnectionString = "Host=www.mydomain.com; user=test; password=****; database=test;pooling=false"
    Try
        conn.Open()
    Catch myerror As MySqlException
        MsgBox("Error connecting to database! " & myerror.Message)
    End Try

This is message error:

"Error connection to database! Access denied for user 'test'@114.134.189.135' (using password: YES)".

Please help me to solve it.

Upvotes: 0

Views: 665

Answers (1)

Bala
Bala

Reputation: 648

1.Verify that MySQL service is running on your target machine
2. Ensure that user 'test' having the password 'YES'<br>
2.1 Please login any MySQl UI (Eg.,SQLYog)with your username and password for confirmation
3. If not, create a new user
   CREATE USER 'username'@'localhost' IDENTIFIED BY 'password';

Upvotes: 1

Related Questions