mysql server连接问题
各位高人们,我遇到一个应该是简单,但是对我来说很烦的问题。baidu,google都查不出原因。
我装的mysql和php,当我试图连接的时候出现了错误。
我的mysql连接错误
Warning: mysql_connect() [function.mysql-connect]: [2002] No connection could be made because the target machine actively (trying to connect via tcp://localhost:3306) in D:\server\sites\portfolio\hireme\hireme_content.php on line 38
Warning: mysql_connect() [function.mysql-connect]: No connection could be made because the target machine actively refused it. in D:\server\sites\portfolio\hireme\hireme_content.php on line 38
Could not connect: No connection could be made because the target machine actively refused it.
我的php 代码
<?php
$con = mysql_connect("localhost","root","password");
if(!$con)
{
die("Could not connect: " . mysql_error());
}
?>
我在mysql workbench下面重复检查了一下是在port 3306下面的。用户名密码也不会错,mysql workbench连到数据库一切正常。
希望高人给与指点。谢谢了。