#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2000
    Posts
    10
    Rep Power
    0
    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 ?
  2. #2
  3. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2000
    Posts
    10
    Rep Power
    0
    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)

Similar Threads

  1. simple home network problem
    By geo315 in forum Networking Help
    Replies: 1
    Last Post: February 13th, 2004, 05:03 AM
  2. Custom error message for MySQL connection
    By dbr1066 in forum PHP Development
    Replies: 6
    Last Post: February 12th, 2004, 12:25 PM
  3. simple problem, please help...
    By poncenby in forum Apache Development
    Replies: 2
    Last Post: February 6th, 2004, 03:59 AM
  4. A simple problem?
    By adavidso in forum Python Programming
    Replies: 1
    Last Post: February 3rd, 2004, 02:38 PM
  5. Mod Rewrite (hopefully simple) problem!
    By bu22 in forum Apache Development
    Replies: 0
    Last Post: January 26th, 2004, 02:13 PM

IMN logo majestic logo threadwatch logo seochat tools logo