Results 1 to 4 of 4
  1. #1
    Join Date
    Dec 2005
    Posts
    266

    Unanswered: mySQL + PHP >> SELECT command denied to user ''@'localhost' for table 'menu' :: 1142

    I am using php wamp 2.0 on windows xp pro

    my code
    Code:
    $server = "localhost";
    $username = "root";
    $password = "";
    $database = "rufus";
    
    $con = mysql_connect($server,$username,$password);
    
    if (!$con)
      {
      die($errDbConn . mysql_error() . " :: " . mysql_errno());
      }
    
    $db_selected = mysql_select_db($database, $con);
    
    $result = mysql_query("SELECT * FROM rufus.menu;");
    and I'm receiving the following error: SELECT command denied to user ''@'localhost' for table 'menu' :: 1142

    mySQL is runing , database and tables are ok

    I have tried
    mysql > GRANT SELECT, INSERT, UPDATE, DELETE on anselme.* TO 'root'@'%' IDENTIFIED BY '';

    mysql > SHOW GRANTS FOR root;


    I get
    GRANT USAGE ON *.* TO 'root'@'%'
    GRANT SELECT, INSERT, UPDATE, DELETE on anselme.* TO 'root'@'%'


    but allways the same error 1142

    thanks for helping
    Last edited by anselme; 07-14-08 at 04:23.

  2. #2
    Join Date
    Jan 2009
    Posts
    1

    error 1142

    anselme,

    in the linhe: $result = mysql_query("SELECT * FROM rufus.menu;");

    DELETE references for the database rufus.

    Line final:

    $result = mysql_query("SELECT * FROM menu;");


    Regards,

    Yuri Novaes

  3. #3
    Join Date
    Jan 2009
    Posts
    2
    Hi there

    i am having a problem on connecting to Database Server , i have configured MySql and it's running but when i try to configure a database for Testlink application i get this error " TestLink setup will now attempt to setup the database:Creating connection to Database Server: Failed! "

    Thanks for your help.

  4. #4
    Join Date
    Dec 2005
    Posts
    266
    it works

    thank you

Posting Permissions

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