CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    May 2005
    Posts
    178

    connect to MySql

    im trying to connect to MySql like that-
    Code:
    MySql.Data.MySqlClient.MySqlConnection con;
    						
    string conStr = "Database=dbnet;"+
    	         "Server=127.0.0.1;"+
    	         "User Id=Admin;" +
                             "Password=;";
    
    con=new MySql.Data.MySqlClient.MySqlConnection(conStr);	
    con.Open();
    and im getting the error-
    #28000Access denied for user 'Admin'@'localhost' (using password: NO)

    what im doing wrong?
    thanks in advanced

  2. #2
    Join Date
    Mar 2004
    Location
    33°11'18.10"N 96°45'20.28"W
    Posts
    1,808

    Re: connect to MySql

    you need to make sure you have that user defined in mysql. typically admin is 'root' unless you added Admin and granted perms for it (and granted connection priv's from 'localhost').

  3. #3
    Join Date
    May 2005
    Posts
    178

    Smile Re: connect to MySql

    its ok now
    thanks for the help

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured