Please help. The database cannot load the driver. how can this problem be solved?

Source: Internet
Author: User
Please help. The database cannot load the driver. how can this problem be solved? Namespace Home \ Controller;
Use Think \ Controller;
Class IndexController extends Controller {
Public function index (){
$ Data = M ('oa _ News ');
$ This-> data = $ Data-> select ();
$ This-> display ();
}
}
?>

Return array (

'Db _ type' => 'mysql ',
'Db _ host' => 'localhost ',
'Db _ name' => 'wechar ',
'Db _ user' => 'root ',
'Db _ pwd' => 'root ',
'Db _ port' = & gt; 3306,

);












:(
Unable to load database Driver: Think \ Db \ Driver \
Error location
FILE: E: \ ThinkPHP \ Library \ Think \ Db. class. php LINE: 42
TRACE
#0 E: \ ThinkPHP \ Library \ Think \ Db. class. php (42): E ('\ xE6 \ x97 \ xA0 \ xE6 \ xB3 \ x95 \ xE5 \ x8A \ xA0 \ xE8 \ xBD \ xE6 \ x95 \ xB0... ')
#1 E: \ ThinkPHP \ Library \ Think \ Model. class. php (1423): Think \ Db: getInstance ('')
#2 E: \ ThinkPHP \ Library \ Think \ Model. class. php (97): Think \ Model-> db (0, '', true)
#3 E: \ ThinkPHP \ Common \ functions. php (621): Think \ Model->__ construct ('oa _ News ','','')
#4 C: \ xampp \ htdocs \ app \ Application \ Home \ Controller \ IndexController. class. php (6): M ('oa _ News ')
#5 [internal function]: Home \ Controller \ IndexController-> index ()
#6 E: \ ThinkPHP \ Library \ Think \ App. class. php (164): ReflectionMethod-> invoke (Object (Home \ Controller \ IndexController ))
#7 E: \ ThinkPHP \ Library \ Think \ App. class. php (205): Think \ App: exec ()
#8 E: \ ThinkPHP \ Library \ Think. class. php (120): Think \ App: run ()
#9 E: \ ThinkPHP. php (97): Think \ Think: start ()
#10 C: \ xampp \ htdocs \ app \ index. php (24): require ('E: \ ThinkPHP \ Thi ...')
#11 {main}


Reply to discussion (solution)

Your MySQL instance is not started, or the mysql extension is not loaded.

You can try 127.0.0.1. maybe your loacalhost cannot access mysql.

The problem has been solved. thank you.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.