8 Replies - 626 Views - Last Post: 19 August 2010 - 08:04 PM Rate Topic: -----

#1 antarr.byrd  Icon User is offline

  • D.I.C Head

Reputation: 6
  • View blog
  • Posts: 247
  • Joined: 30-August 09

Connecting To MySQL

Posted 19 August 2010 - 05:29 PM

I know this has been asked before to an extent but none of them seem to help me.

I'm trying to connected to mySQL server. But I keep getting an error,

Quote

Access denied for user ''@'localhost' (using password: NO)



protected void Page_Load(object sender, EventArgs e)
        {
            con.ConnectionString = "Server=http://wwww.mysite.com;Database=mysite_test;Uid=mysite_user;Pwd=test";
            
            con.Open();
        }

private void button1_Click(object sender, EventArgs e)
        {
            //Let us just get connect and display the table in a GridView.
            MySqlDataAdapter dr = new MySqlDataAdapter("CREATE TABLE Members(FirstName varchar(15),LastName varchar(15),Age int);", con);
            DataSet ds = new DataSet();
            dr.Fill(ds);
            dataGridView1.DataSource = ds;
            //dataGridView1.DataBind();
        }

This post has been edited by antarr.byrd: 19 August 2010 - 05:31 PM


Is This A Good Question/Topic? 0
  • +

Replies To: Connecting To MySQL

#2 Crunch  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 139
  • View blog
  • Posts: 1,222
  • Joined: 28-July 09

Re: Connecting To MySQL

Posted 19 August 2010 - 05:36 PM

View Postantarr.byrd, on 19 August 2010 - 11:29 PM, said:

Access denied for user ''@'localhost' (using password: NO)


You have left the password field blank. Enter the correct password and try again.

(Your test variable must be empty)
Was This Post Helpful? 0
  • +
  • -

#3 antarr.byrd  Icon User is offline

  • D.I.C Head

Reputation: 6
  • View blog
  • Posts: 247
  • Joined: 30-August 09

Re: Connecting To MySQL

Posted 19 August 2010 - 05:41 PM

View PostCrunch, on 19 August 2010 - 04:36 PM, said:

View Postantarr.byrd, on 19 August 2010 - 11:29 PM, said:

Access denied for user ''@'localhost' (using password: NO)


You have left the password field blank. Enter the correct password and try again.

(Your test variable must be empty)



It's not empty, unless i dont understand the connection string

Pwd=test

Was This Post Helpful? 0
  • +
  • -

#4 Crunch  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 139
  • View blog
  • Posts: 1,222
  • Joined: 28-July 09

Re: Connecting To MySQL

Posted 19 August 2010 - 06:23 PM

where is your mysql server located? At localhost or somewhere on the network ?
Was This Post Helpful? 0
  • +
  • -

#5 antarr.byrd  Icon User is offline

  • D.I.C Head

Reputation: 6
  • View blog
  • Posts: 247
  • Joined: 30-August 09

Re: Connecting To MySQL

Posted 19 August 2010 - 06:52 PM

View PostCrunch, on 19 August 2010 - 05:23 PM, said:

where is your mysql server located? At localhost or somewhere on the network ?


hosted by siteground, I already gave my ip remote access.
Was This Post Helpful? 0
  • +
  • -

#6 Crunch  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 139
  • View blog
  • Posts: 1,222
  • Joined: 28-July 09

Re: Connecting To MySQL

Posted 19 August 2010 - 06:55 PM

Then why does your error message say

Quote

Access denied for user ''@'localhost' (using password: NO)


Localhost ?
Was This Post Helpful? 0
  • +
  • -

#7 antarr.byrd  Icon User is offline

  • D.I.C Head

Reputation: 6
  • View blog
  • Posts: 247
  • Joined: 30-August 09

Re: Connecting To MySQL

Posted 19 August 2010 - 07:13 PM

View PostCrunch, on 19 August 2010 - 05:55 PM, said:

Then why does your error message say

Quote

Access denied for user ''@'localhost' (using password: NO)


Localhost ?



I have no idea
Was This Post Helpful? 0
  • +
  • -

#8 antarr.byrd  Icon User is offline

  • D.I.C Head

Reputation: 6
  • View blog
  • Posts: 247
  • Joined: 30-August 09

Re: Connecting To MySQL

Posted 19 August 2010 - 08:03 PM

View PostCrunch, on 19 August 2010 - 05:55 PM, said:

Then why does your error message say

Quote

Access denied for user ''@'localhost' (using password: NO)


Localhost ?



Well its working now, but I'm being denied Access to the Select command although the user has all privileges
Was This Post Helpful? 0
  • +
  • -

#9 Crunch  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 139
  • View blog
  • Posts: 1,222
  • Joined: 28-July 09

Re: Connecting To MySQL

Posted 19 August 2010 - 08:04 PM

Well done :bananaman:
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1