当前位置:编程学习 > php >>

你的mysql测试弄好了么?就是哪个php测试mysql的信息!

追问:<?php $link=mysql_connect("localhost","root","00000000"); if(!$link) echo "连接数据库失败!" ; else echo "连接数据库成功!" ; mysql_close(); ?> 保存为test.php,测试连接mysql,结果失败!提示如下!:Warning: mysql_connect() [function.mysql-connect]: Can't connect to local MySQL server through socket '/tmp' (146) in /web/test.php on line 2 连接数据库失败! Warning: mysql_close(): no MySQL-Link resource supplied in /web/test.php on line 5 如果把localhost改成127.0.0.1 结果连接成功!
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,