If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > mySQL + PHP >> SELECT command denied to user ''@'localhost' for table 'menu' :: 1142

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-14-08, 02:52
anselme anselme is offline
Registered User
 
Join Date: Dec 2005
Posts: 266
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 03:23.
Reply With Quote
  #2 (permalink)  
Old 01-19-09, 15:16
Yuri Novaes Yuri Novaes is offline
Registered User
 
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
Reply With Quote
  #3 (permalink)  
Old 01-20-09, 09:39
bougalove bougalove is offline
Registered User
 
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.
Reply With Quote
  #4 (permalink)  
Old 01-21-09, 04:31
anselme anselme is offline
Registered User
 
Join Date: Dec 2005
Posts: 266
it works

thank you
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On