I am experiencing a strange problem when trying to connect to a MySQL server. I have written a short connection script (PHP) :
<?php
$link = mysql_connect ("myserver", "myusername", "mypwd")
or die ("Could not connect");
print ("Connected successfully");
mysql_close ($link);
?>
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 ?
<?php
$link = mysql_connect ("myserver", "myusername", "mypwd")
or die ("Could not connect");
print ("Connected successfully");
mysql_close ($link);
?>
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 ?