mysql server连接问题

edisonwinner 2011-06-20 09:43:03
各位高人们,我遇到一个应该是简单,但是对我来说很烦的问题。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连到数据库一切正常。

希望高人给与指点。谢谢了。







...全文
64 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
--小F-- 2011-06-20
  • 打赏
  • 举报
回复
建议去 mysql问问
kevn 2011-06-20
  • 打赏
  • 举报
回复
问错区了
sadikaqy 2011-06-20
  • 打赏
  • 举报
回复
看不懂,建议楼主到PHP或MySQL板块去问问。。。
AcHerat 元老 2011-06-20
  • 打赏
  • 举报
回复
mysql php

MSSQL解决不了吧!

34,588

社区成员

发帖
与我相关
我的任务
社区描述
MS-SQL Server相关内容讨论专区
社区管理员
  • 基础类社区
  • 二月十六
  • 卖水果的net
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧