duanliangman5398 2015-12-09 04:11
浏览 44

WAMP Mysqli没有工作,而Mysql工作

I upgraded from Windows 7 to Windows 10 recently, and installed WAMP. This is my first time working with WAMP.

I am getting following error message in one of my Codeigniter project I was working in windows 7 setup and I don't know what to make of it. The page keeps on loading and loading and then fails with the error message.

Message: mysqli::real_connect(): (HY000/2002): A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.

This is my database config settings :

$db['default'] = array(
    'dsn'   => '',
    'hostname' => 'localhost',
    'username' => 'root',
    'password' => '',
    'database' => 'studentx',
    'dbdriver' => 'mysqli',
    'dbprefix' => '',
    'pconnect' => FALSE,
    'db_debug' => TRUE,
    'cache_on' => FALSE,
    'cachedir' => '',
    'char_set' => 'utf8',
    'dbcollat' => 'utf8_general_ci',
    'swap_pre' => '',
    'encrypt' => FALSE,
    'compress' => FALSE,
    'stricton' => FALSE,
    'failover' => array(),
    'save_queries' => TRUE
);

If I change 'dbdriver' => 'mysqli', part of the config to 'dbdriver' => 'mysql', then it works with the warning of deprecated mysql extension.

What's going on ?

  • 写回答

4条回答 默认 最新

  • douzhi2012 2015-12-09 04:36
    关注

    First, make sure that the php.ini file is loading the mysqli extension.

    How to check Click on wamp icon (taskbar) the icon in the system tray , go to PHP -> PHP Extensions and make sure php_mysqli is checked. If not then go into the php.ini file and make sure that the line: extension=php_mysqli.dll is uncommented (eg, remove the ; if it exists). If that line does not exist, add it.

    php.ini path C:\wamp\bin\apache\Apache*..\bin\php.in

    评论

报告相同问题?

悬赏问题

  • ¥20 机器学习能否像多层线性模型一样处理嵌套数据
  • ¥20 西门子S7-Graph,S7-300,梯形图
  • ¥50 用易语言http 访问不了网页
  • ¥50 safari浏览器fetch提交数据后数据丢失问题
  • ¥15 matlab不知道怎么改,求解答!!
  • ¥15 永磁直线电机的电流环pi调不出来
  • ¥15 用stata实现聚类的代码
  • ¥15 请问paddlehub能支持移动端开发吗?在Android studio上该如何部署?
  • ¥20 docker里部署springboot项目,访问不到扬声器
  • ¥15 netty整合springboot之后自动重连失效