Home >Backend Development >PHP Tutorial >PHP中$link=mysql_connect("localhost""root""");解决思路

PHP中$link=mysql_connect("localhost""root""");解决思路

WBOY
WBOYOriginal
2016-06-13 10:13:101070browse

PHP中$link=mysql_connect("localhost","root","");
本地系统Apache 2.2.22+PHP5.3.9+MySQL 5.5中,PHP5.3.9运行以下程序时无法连接MySQL 5.5  
$link=mysql_connect('localhost','root','');

if($link) echo "连接成功";
else echo "连接失败";
mysql_close();
?>
用此法验证MySQL是否安装成功时,
为什么显示Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' on line 5
应该没有什么语法错误。。

------解决方案--------------------
php根目录下 把那些个 lib 和 nt 开头的都复制到 system32目录内 
还有一个是 把 php.ini配置文件 里面的 ext路径改为php的正确目录位置

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn