gc40 Posted August 24, 2007 Share Posted August 24, 2007 Greetings All, I have been for the longest while testing my .php website files by uploading them to my server first and going to the URL. However, this is the biggest waste of time ever. I finally decided to setup Apache2 Server and php 5 on my system. I also setup a mysql database. However, when i try to connect to an external database located on my server to test my application, I get no connection. I tested my connection with a script like this: <?php $username = "pee_wee"; $password = "let_me_in"; $hostname = "mysql.mywebsite.com"; $dbh = mysql_connect($hostname, $username, $password) or die("Unable to connect to MySQL"); print "Connected to MySQL<br>"; // you're going to do lots more here soon mysql_close($dbh); ?> Of course I enter the right connection info. I then take this same test connection file, upload it to my server and I get the echo 'Connected to MySQL'. When i test it on my local machine, I don't get any errors, or outputs. Does anyone know why this may be happening? I am not behind any firewalls, or anything of that nature. I think its a problem with how I setup apache2 or php or something. Does anyone know how I can get a mysql database working on my local system prefferably with phpmyadmin? Quote Link to comment Share on other sites More sharing options...
vijayfreaks Posted August 24, 2007 Share Posted August 24, 2007 Hi.. It depends on your server or connection from your system to remote server.. If its not there then you can have this error.. Regards, Vijay Quote Link to comment Share on other sites More sharing options...
thryb Posted August 24, 2007 Share Posted August 24, 2007 go to my.cnf and comment this line #bind-address = 127.0.0.1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.