I'm working with a PHP/MySQL shopping application (oscommerce) and I am running the application with Database on one server (server1.com) and would like to run the admin and checkout portions of the application on a second secure server (server2.com).
I am able to reference the MySQL database on one server from the secure server using PHP and a standard connection method:
//Connecting to the database
$con = mysql_connect("server1.com😛ort","testuser","password") or die ("Couldn't connect to server");
//Specifying the database
$db = mysql_select_db("database", $con) or die ("Couldn't connect to database");
But I get the following error, when it tries to authenticate the user:
Mozilla/4.0 (compatible; MSIE 5.5; Windows 98; T312461)
Warning: MySQL Connection Failed: Access denied for user: 'testuser@server2.com' (Using password: YES) in /usr/local/htdocs/lakeview/test1.php on line 14
Couldn't connect to server
Rather than trying to log testuser into MySQL on server1.com, it is trying to login testuser@server2.com...who is obviously not a valid user for that database on server1.com.
Is there anyway to prevent PHP from passing testuser@server2.com as the login user? I just need to be able to login testuser with not @ or identification of the server the request is originating from.
Thanks in advance for any advice on how to do this.