Re: Connect User from website does not work.

From: Date: Mon, 14 Jul 2003 15:45:48 +0000
Subject: Re: Connect User from website does not work.
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-29236@lists.php.net to get a copy of this message
> I have created a user "webuser" with the following line. > > > > mysql> grant all privileges on *.* to webuser@Sarreid2 identified by > 'xxxxxx'; > > mysql> grant all privileges on *.* to webuser@localhost identified by > 'xxxxxx'; > > > > I would think that this should have unlimited access to the database > from the website.? > > I can connect to mysql from the command line using the user webuser. I > received no errors when I created the user and verified that the user > exist in the user database. > > > > When I try to connect to the database I get the following error: > > > > Warning: Access denied for user: 'webuser@www.Sarreid2.com' (Using > password: YES) in /var/www/html/count/get_conf.inc.php on line 4 > > Warning: MySQL Connection Failed: Access denied for user: > 'webuser@www.Sarreid2.com' (Using password: YES) in > /var/www/html/count/get_conf.inc.php on line 4 As you can see from the error message, you're not connecting from "localhost". When trying to connect from a PHP script, MySQL sees you as coming from a host www.Sarreid2.com. So, use another GRANT command to also grant your user permission from this host. ---John Holmes...

« previous php.db (#29236) next »