1、下载mysql安装包;
2、安装mysql;
3、在PHP安装目录下修改php.ini文件
在php.ini文件中,找到这两句
;extension=php_mysql.dll
;extension=php_mysqli.dll 改为:
extension=php_mysql.dll
extension=php_mysqli.dll4、测试:
<?php

$conn = mysql_connect("localhost","root","111111");

if($conn){
echo "连接数据库成功!";
}
else{

echo "连接数据库失败!";
}

?>