apache-php安装mysql简单方法

1.启用mysql功能,php.ini

extension=php_mysql.dll

extension=php_mysqli.dll

2. 修改extension_dir = "ext",去掉前面的“;”,并改成extension_dir ="ext路径",比如我是extension_dir = "E:/apache_php_mysql_appadmin/php-5.6.22-Win32-VC11-x64/ext"即可测试!

3.测试代码:

<?php

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

       if($conn){

       echo "连接mysql数据库ok";

       }else{

              echo "连接数据库失败";

       }

?>

 

posted @ 2016-06-02 16:31  韦炳田  阅读(172)  评论(0编辑  收藏  举报