php - mysql_connect(): Connection refused -
i wondering if possible databases block sql accesses through mysql_connect
. downloaded xampp , created sql database using own computer local host , wrote php file accessed database.
however, when tried change username , host settings xampp run php files connect external sql database of free hosting site i'm trying use (biz.co.nf), got following error message:
warning: mysql_connect(): connection refused in /applications/xampp/xamppfiles/htdocs/...
right i'm thinking either:
my login credentials database incorrect, or
somehow host blocks sql accesses external users, if load php code server using filezilla, should work okay?
please let me know if case.
i'm have right login credentials.
here's have:
$host = "fdb13.biz.nf"; $username = "1764941_login"; $password = ________; $db_name = "1764941_login";! $tbl_name = "members"; //connect server mysql_connect($host, $username, $password)or die("cannot connect!"); mysql_select_db($db_name)or die("cannot select database");
with server settings according website...
of course, omitted password.
connections refused remote locations mysql security reasons. can add ip address enable mysql listen database following instructions in link - cyberciti biz tips on enabling remote access mysql database server in case, add ip address of location php script.
mysql_connect
is deprecated in php. use mysqli instead. check comments in link - php original mysql api
Comments
Post a Comment