|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2003-05-05 08:54 UTC] dziugas dot baltrunas at m-1 dot lt
We are currently using MySQL 4.0.12. This bug occurs occasionaly and there is no way to guess what makes it appear. Even if there are "hardcoded" username and password into the function, i.e. not passing variables to it, like mysql_connect("mysql.host", "public", "secret"), PHP reports Warning:
[05-May-2003 14:06:17] PHP Warning: mysql_connect() [<a href='http://www.php.net/function.mysql-connect'>function.mysql-connect</a>]: Access denied for user: 'public@10.10.12.254' (Using password: NO) in /var/www/sala.lt/htdocs/skundai/classes/db.php on line 10
So the problem is that warning (or mysql_error() message) about not using password is not correct.
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 09:00:01 2025 UTC |
As I said, seems like password retrieval makes no difference. I have connectdb() function which look like this: function connectdb() { global $mysql_host, $mysql_user, $mysql_pass, $dbid; $dbid = mysql_connect( $mysql_host, $mysql_user, $mysql_pass); if(!$dbid) { $file = fopen("/tmp/mysql-err", "a+"); $line = $_SERVER['PHP_SELF'] . ":" . date("Y-m-d H:i:s"); $line .= ":$mysql_host:$mysql_user:$mysql_pass - $dbid:" . mysql_error() . "\n"; fputs($file, $line); fclose($file); } return $dbid; } and here is what gets logged into /tmp/mysql-err: /index.php:2003-05-05 14:30:53:db1.m-1.lan:public:secret - :Access denied for user: 'public@10.10.12.254' (Using password: NO) so function retrieves the password fine.