Patrick Posted January 15, 2003 Share Posted January 15, 2003 Hi, I hoping that someone will be able to help me, I\'m getting an odd error, that I can not seem to get to the bottom of. When attempting to access a list page, I get put through to the login screen and after successfully entering a valid user name and password I get put through to the page I expected, which is a list of database records. Upon clicking a link to add or edit a record I get the error below. Is anyone able to give me any ideas as to what might cause this to happen upon editing or adding a record. The user is a root user with all privileges and both the list and edit screens have the same security restrictions. Using CodeCharge Studio, Apache 2.0.43, PHP 4.2.3, MySQL 3.23.54, with MySQL and Apache running as services on Windows 2000 where applicable. I get the same error when running from a Unix test server running similar versions. Most appreciative if anyone could give any advice. Patrick ERROR Warning: Access denied for user: \'patrick@localhost\' (Using password: YES) in /home/patrick/public_html/test/xyz.php on line x Warning: MySQL Connection Failed: Access denied for user: \'patrick@localhost\' (Using password: YES) in /home/whitit/public_html/test/xyz.php on line x Database error: pconnect(localhost, patrick, $Password) failed. MySQL Error: () Session halted. Quote Link to comment https://forums.phpfreaks.com/topic/49-mysql-authentication-error/ Share on other sites More sharing options...
effigy Posted January 15, 2003 Share Posted January 15, 2003 run this in mysql as root to be sure: grant all on database_name.* to patrick@localhost identified by \'your_password_here\'; you might also try quoting the arguments in pconnect. Quote Link to comment https://forums.phpfreaks.com/topic/49-mysql-authentication-error/#findComment-121 Share on other sites More sharing options...
Patrick Posted January 15, 2003 Author Share Posted January 15, 2003 Thanks for such a quick reply effigy, I\'ve tried both of your suggestions but so far not having any luck. The pconnect arguments are held in variables. The strange thing is that it connects for authentication, and for displaying the list, but refuses authorisation for the add/edit screen. I\'m thinking it is to do with permission settings, but I can\'t find any differences with the permissions between the pages, or any anomaly in the MySQL users database. Any further thoughts? Any help is appreciated. Once again, thanks for your reply. Patrick Quote Link to comment https://forums.phpfreaks.com/topic/49-mysql-authentication-error/#findComment-123 Share on other sites More sharing options...
effigy Posted January 15, 2003 Share Posted January 15, 2003 very odd. you can try appending... or die ( mysql_errno() . \' \' . mysql_error() ); ...to your mysql statements to see if it returns any more specifics on the problem. have you tried using mysql_connect() instead? something could be awry in your php.ini pconnect settings... Quote Link to comment https://forums.phpfreaks.com/topic/49-mysql-authentication-error/#findComment-125 Share on other sites More sharing options...
Patrick Posted January 15, 2003 Author Share Posted January 15, 2003 Thank you, I have tried both connect and pconnect with the same results, again with no luck. It has however, confirmed that it is a problem with permissions and not with the connect. I\'m racking my brains to think what is not right with the permissions - especially having used the grant statement you mentioned earlier... it is a puzzle. Any more ideas appreciated, but thank you very much for your assistance. Patrick Quote Link to comment https://forums.phpfreaks.com/topic/49-mysql-authentication-error/#findComment-127 Share on other sites More sharing options...
effigy Posted January 15, 2003 Share Posted January 15, 2003 this is a good one patrick — can you post or link to your php.ini and my.cnf? also, can you connect to mysql as root via the command line interface and check the grant tables? - use mysql; - select * from db where User=\'patrick\'; Quote Link to comment https://forums.phpfreaks.com/topic/49-mysql-authentication-error/#findComment-136 Share on other sites More sharing options...
Patrick Posted January 18, 2003 Author Share Posted January 18, 2003 effigy, thank you for your assistance, but I came up with a new theory... If it doesn\'t work and you can\'t fix it throw it out and start again. Might not be very good, but the problem is gone and I\'m happy. I suspect that there was a conflict with the code generator I\'m using, it\'s very powerful and I\'m still getting used to it. It turned out that the error messages were generated by Code Charge and that helped to confuse me a bit. Thanks again, Patrick. Quote Link to comment https://forums.phpfreaks.com/topic/49-mysql-authentication-error/#findComment-169 Share on other sites More sharing options...
MrOnline Posted January 18, 2003 Share Posted January 18, 2003 Be sure to restart mysql and possibly your webserver after making changes to users. Quote Link to comment https://forums.phpfreaks.com/topic/49-mysql-authentication-error/#findComment-170 Share on other sites More sharing options...
Patrick Posted January 18, 2003 Author Share Posted January 18, 2003 Thanks, some such things are very easily overlooked... Quote Link to comment https://forums.phpfreaks.com/topic/49-mysql-authentication-error/#findComment-172 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.