3 Replies - 3017 Views - Last Post: 18 February 2013 - 11:13 AM Rate Topic: -----

#1 kyle_denney  Icon User is offline

  • D.I.C Head

Reputation: -1
  • View blog
  • Posts: 136
  • Joined: 10-August 12

Error Connecting To MySQL Database

Posted 17 February 2013 - 08:47 PM

Hello!

I am getting an error when connecting to MySQL database. For some reason I cannot gain access to my database. I have used similar code to connect to another database on another server in a previous application but cannot do it for this one. Is it a configuration issue or a code issue? If so what changes do I need to make. I am using cPanel and phpMyAdmin. Thanks!

Here is my code :


            Dim dr As MySqlDataReader
            Dim cmd As MySqlCommand

            conn = New MySqlConnection("Server=IPADDRESS;Port=3306;Database=DATABASENAME;Uid=USERID;Pwd=PASSWORD;")
            conn.Open()


          cmd = New MySqlCommand("SELECT FIELD FROM TABLE WHERE FIELD= '" & VALUE & "'", conn)             
          dr = cmd.ExecuteReader()             
            If dr.HasRows = True Then 
                While dr.Read = True

                End While
            End If



Is This A Good Question/Topic? 0
  • +

Replies To: Error Connecting To MySQL Database

#2 modi123_1  Icon User is offline

  • Suitor #2
  • member icon



Reputation: 9287
  • View blog
  • Posts: 34,811
  • Joined: 12-June 08

Re: Error Connecting To MySQL Database

Posted 17 February 2013 - 09:46 PM

It would be great to know the error..
Was This Post Helpful? 0
  • +
  • -

#3 kyle_denney  Icon User is offline

  • D.I.C Head

Reputation: -1
  • View blog
  • Posts: 136
  • Joined: 10-August 12

Re: Error Connecting To MySQL Database

Posted 18 February 2013 - 11:08 AM

The error states this:

AUTHENTICATION FOR HOST (IP ADDRESS) FOR (DATABASE NAME) FOR METHOD MYSQL_NATIVE_PASSWORD FAILED WITH MESSAGE ACCESS IS DENIED WITH USER USING PASSWORD = YES

Not sure what this error means but I even re-created the database and password and to no avail.
Was This Post Helpful? 0
  • +
  • -

#4 modi123_1  Icon User is offline

  • Suitor #2
  • member icon



Reputation: 9287
  • View blog
  • Posts: 34,811
  • Joined: 12-June 08

Re: Error Connecting To MySQL Database

Posted 18 February 2013 - 11:13 AM

Just googling 'FOR METHOD MYSQL_NATIVE_PASSWORD FAILED WITH MESSAGE ACCESS IS DENIED WITH USER USING PASSWORD = YES' more or less points to the server you are trying to connect to doesn't like you credentials.. or doesn't like peeps connecting from elsewhere. Talk to who ever set up your db.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1