note 70315 rejected from function.mysql-connect by vincent
| From: | vincent@php.net | Date: | Wed, 11 Oct 2006 15:42:26 +0000 |
| Subject: | note 70315 rejected from function.mysql-connect by vincent | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-118417@lists.php.net to get a copy of this message | ||
Note Submitter: neohades at orange dot pl
----
HI!
Recently i encountered a strange error, i have a MySQL database server (lets name it:
sqlserver.com), but it's different than the server that the page is on (lets name this one:
siteserver.com), when i try to connect through PHP to that MySQL database, the operation ends with
an error:
"Warning: mysql_connect() [function.mysql-connect]: Access denied for user
'user'@'siteserver.com' (using password: YES) in /home/.../query.php on line
2"
So as you can see it states siteserver.com insted of sqlserver.com that is written on the second
line of my query.php file.
The second line states exactly:
"$con = mysql_connect("sqlserver.com","user","pass")
or die ('I cannot connect to the database because: ' . mysql_error());"
So it suppose to connect to that particular (sqlserver.com)server, and although PHP still tries to
connect to the MySQL server that is on the server that tha page is on (siteserver.com).
Can anyone tell me why it is happening? And how to make it work?