[PHP-DB] Access denied for user...sometimes???
I've got 5.0.27-standard installed on an Intel Mac, using the preinstalled version of Apache and my own installation of PHP 4.4.4. I use this machine for development work and don't make it available to anyone else. I've got an instance of a PHP application running, and it works...but not all of the time!!! I created the user that accesses my MySQL via the following commands; use [web_db_name]; grant select, insert, update, delete on *.* to '[new_user]'@'%' identified by '[new_password]'; I'm able to do everything expected from the command line mysql tool, but on the PHP side it fails more than half of the time: Warning: mysql_connect() [function.mysql-connect]: Access denied for user '[new_user]'@'[my_current_dhcp_ip]' (using password: YES) in /[path]/[to]/[page]/[on]/[server]/index.php on line 66 This leaves the question: since MySQL is behaving normally otherwise, I'm using a host of '%' and my IP isn't changing, does anybody know what the problem is with PHP??? TIA, James -- The sender of this email subscribes to Perimeter Internetworking's email anti-virus service. This email has been scanned for malicious code and is believed to be virus free. For more information on email security please visit: http://www.perimeterusa.com/email-defense-content.html This communication is confidential, intended only for the named recipient(s) above and may contain trade secrets or other information that is exempt from disclosure under applicable law. Any use, dissemination, distribution or copying of this communication by anyone other than the named recipient(s) is strictly prohibited. If you have received this communication in error, please delete the email and immediately notify our Command Center at 203-541-3444. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Access denied for user...sometimes???
On Wed, 21 Feb 2007, James Garfield wrote: I've got 5.0.27-standard installed on an Intel Mac, using the preinstalled version of Apache and my own installation of PHP 4.4.4. I use this machine for development work and don't make it available to anyone else. I've got an instance of a PHP application running, and it works...but not all of the time!!! I created the user that accesses my MySQL via the following commands; use [web_db_name]; grant select, insert, update, delete on *.* to '[new_user]'@'%' identified by '[new_password]'; I'm able to do everything expected from the command line mysql tool, but on the PHP side it fails more than half of the time: Warning: mysql_connect() [function.mysql-connect]: Access denied for user '[new_user]'@'[my_current_dhcp_ip]' (using password: YES) in /[path]/[to]/[page]/[on]/[server]/index.php on line 66 This leaves the question: since MySQL is behaving normally otherwise, I'm using a host of '%' and my IP isn't changing, does anybody know what the problem is with PHP??? TIA, James flush privileges --- Peter Beckman Internet Guy [EMAIL PROTECTED] http://www.purplecow.com/ --- -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Access denied for user...sometimes???
Peter Beckman wrote: On Wed, 21 Feb 2007, James Garfield wrote: I've got 5.0.27-standard installed on an Intel Mac, using the preinstalled version of Apache and my own installation of PHP 4.4.4. I use this machine for development work and don't make it available to anyone else. I've got an instance of a PHP application running, and it works...but not all of the time!!! I created the user that accesses my MySQL via the following commands; use [web_db_name]; grant select, insert, update, delete on *.* to '[new_user]'@'%' identified by '[new_password]'; I'm able to do everything expected from the command line mysql tool, but on the PHP side it fails more than half of the time: Warning: mysql_connect() [function.mysql-connect]: Access denied for user '[new_user]'@'[my_current_dhcp_ip]' (using password: YES) in /[path]/[to]/[page]/[on]/[server]/index.php on line 66 This leaves the question: since MySQL is behaving normally otherwise, I'm using a host of '%' and my IP isn't changing, does anybody know what the problem is with PHP??? TIA, James flush privileges And, as it's only you using mysql from the current machine, you don't need a network connection to your own machine - use localhost instead of your dynamic(?) IP, and set skip-networking (or whatever it is called) to on in your my.cnf file. Cheers -- David Robley Useless Invention: Checkered paint. Today is Pungenday, the 53rd day of Chaos in the YOLD 3173. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] access denied
i get this error: Warning: Access denied for user: '[EMAIL PROTECTED]' (Using password: YES) in C:\Inetpub\localroot\aichlmayr.net\sites\aaron\module\runescape\runerunner\s ervices.php on line 3 and the code up to line 3 is: ?php //Database Querys $connection=Mysql_connect($dbHost , $dbName , $dbPassword); i have included this in another script that sets $dbHost, $dbName and, $dbPassword to the correct things to connect to the db -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] access denied
Hi! I think you not set this variables. Try to read your full errorlog but not only one part. Saturday, June 26, 2004, 7:37:36 PM, water_foul wrote: w i get this error: w Warning: Access denied for user: '[EMAIL PROTECTED]' (Using w password: YES) in w C:\Inetpub\localroot\aichlmayr.net\sites\aaron\module\runescape\runerunner\s w ervices.php on line 3 w and the code up to line 3 is: w ?php w //Database Querys w $connection=Mysql_connect($dbHost , $dbName , $dbPassword); w w i have included this in another script that sets $dbHost, $dbName and, w $dbPassword to the correct things to connect to the db -- Best regards, Mikhail U. Petrov mailto:[EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] access denied
I did set the veriables just in another script that includes this swcript Mikhail U. Petrov [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi! I think you not set this variables. Try to read your full errorlog but not only one part. Saturday, June 26, 2004, 7:37:36 PM, water_foul wrote: w i get this error: w Warning: Access denied for user: '[EMAIL PROTECTED]' (Using w password: YES) in w C:\Inetpub\localroot\aichlmayr.net\sites\aaron\module\runescape\runerunner\s w ervices.php on line 3 w and the code up to line 3 is: w ?php w //Database Querys w $connection=Mysql_connect($dbHost , $dbName , $dbPassword); w w i have included this in another script that sets $dbHost, $dbName and, w $dbPassword to the correct things to connect to the db -- Best regards, Mikhail U. Petrov mailto:[EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Access denied for user: '@localhost'
Hi, this problem seems to have appeared after a system upgrade ... command line works fine mysql -uschool -pbonfire school BUT ?php /* Connecting, selecting database */ $link = mysql_connect(localhost, school, bonfire) or die(Could not connect : . mysql_error()); print Connected successfully; mysql_select_db(school) or die(Could not select database. mysql_error()); ? results in the following error Connected successfully Could not select database Access denied for user: '@localhost' to database 'school' the logfile shows this ... 030602 18:47:01 33 Connect [EMAIL PROTECTED] as anonymous on 33 Init DB Access denied for user: '@localhost' to database 'school' 33 Quit Any ideas why the connection is being made as anonymous instead of with the details supplied ??? I'm running debian/testing which is up to date and all relavent systems are default install with some config changes... I've tried re-building from scratch apache + php using the latest tarballs (installed to a different location) and still get the same error I've also tried connecting to a different mysql server (same error) - in fact php still tries to connect to localhost ! I'll try installing a new version of mysql ... but any other ideas would be much appreciated -- Sean -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] access denied
Warning: MySQL Connection Failed: Access denied for user: 'rehab@localhost' (Using password: YES) in /home/sites/site92/web/mall/confirmregistration.php on line 14 Error connecting to host localhost, by user rehab should i use this: GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP ON mall.* TO rehab@localhost IDENTIFIED BY 'mall'; or what??? and how should i write this grant statment??? just put it there or like: mysql_query(grant select...)??? -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]