I tried to connect mysql database.but am getting the following error.
Warning:
mysql_connect()
: [2002] No connection could be made because the target machine actively (trying to connect viatcp://localhost:3306
) intest.php
on line 5
Warning:
mysql_connect():
No connection could be made because the target machine actively refused it. in test.php on line 5 Warning:mysql_close()
expects parameter 1 to be resource, boolean given intest.php
on line 15
test.php:
$link = mysql_connect(localhost, dbuser, dbpass);
if (!$link) {
die('Could not connect: ' . mysql_error());
}
echo 'Connected successfully';
mysql_close($link);
?>
No comments:
Post a Comment