RE: [PHP-DB] Newbie Question - mysql_select_db fails with access denied.

From: Date: Fri, 24 Sep 2004 12:43:36 +0000
Subject: RE: [PHP-DB] Newbie Question - mysql_select_db fails with access denied.
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-36375@lists.php.net to get a copy of this message
Hi try $db = mysql_connect("localhost", "myuser","mypassword") - without it you are not submitting a password Peter > -----Original Message----- > From: Christian Schlaefcke [mailto:cschlaefcke@wms-network.de] > Sent: 24 September 2004 13:31 > To: php-db@lists.php.net > Subject: [PHP-DB] Newbie Question - mysql_select_db fails with access > denied. > > > Hi Folks, > > I want to do something like the following: > $db = mysql_connect("localhost", "myuser") or die("Connect failed : > " . > mysql_error()); > > mysql_select_db("mydb",$db) or die("SELECT_DB failed : " . mysql_error > ()); > > $result = mysql_query("SELECT * FROM mytable", $db) or die("Query > failed : " . mysql_error()); > > The script does not proceed beyond the "mysql_select_db" line. I get > this error: > SELECT_DB failed: Access denied for user ''@'localhost' to database > 'mydb' > > What happened to the user information. I have granted all neccessary > rights to "myuser". But it seems that it´s even not caring about the > user. > > I have MySQL 4.1.4 and PHP 4.3.8-2.1 on a Fedore Core 2 System running. > > Thanks & Regards, > > Chris > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

« previous php.db (#36375) next »