October 10th, 2000, 07:21 AM
I am experiencing a strange problem when trying to connect to a MySQL server. I have written a short connection script (PHP) :
$link = mysql_connect ("myserver", "myusername", "mypwd")
or die ("Could not connect");
print ("Connected successfully");
I saved it as connect.php3 and uploaded my file to the web server. When I run the script I get an "access denied" error.
I then tried to connect in command line mode :
mysql -h myserver -u myusername -pmypwd
and the connection is successful...
Then I tried to connect with the same PHP script from another web server, and the connection is successful too...
I really don't understand what's happening... Could anybody help me please ?
October 11th, 2000, 07:03 AM
I have solved my connection problem. I only replaced server name by "localhost" and it works... I don't know exactly why, but it may be linked to the server configuration (I am not admin on this server and I have no way to check access restrictions on it)