AI编程助手
AI免费问答

求帮忙,无法数据库加载驱动,这问题怎么解决

  2016-06-20 12:57   1209浏览 原创

namespace HomeController;
use ThinkController;
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'   => 3306, 

);












:(
无法加载数据库驱动: ThinkDbDriver
错误位置
FILE: E:ThinkPHPThinkPHPLibraryThinkDb.class.php  LINE: 42
TRACE
#0 E:ThinkPHPThinkPHPLibraryThinkDb.class.php(42): E('无法加载数...')
#1 E:ThinkPHPThinkPHPLibraryThinkModel.class.php(1423): ThinkDb::getInstance('')
#2 E:ThinkPHPThinkPHPLibraryThinkModel.class.php(97): ThinkModel->db(0, '', true)
#3 E:ThinkPHPThinkPHPCommon unctions.php(621): ThinkModel->__construct('oa_news', '', '')
#4 C: mpphtdocsppApplicationHomeControllerIndexController.class.php(6): M('oa_news')
#5 [internal function]: HomeControllerIndexController->index()
#6 E:ThinkPHPThinkPHPLibraryThinkApp.class.php(164): ReflectionMethod->invoke(Object(HomeControllerIndexController))
#7 E:ThinkPHPThinkPHPLibraryThinkApp.class.php(205): ThinkApp::exec()
#8 E:ThinkPHPThinkPHPLibraryThinkThink.class.php(120): ThinkApp::run()
#9 E:ThinkPHPThinkPHPThinkPHP.php(97): ThinkThink::start()
#10 C: mpphtdocsppindex.php(24): require('E:\ThinkPHP\Thi...')
#11 {main}


回复讨论(解决方案)

你的 MySQL 没有启动,或没有加载 mysql 扩展

你可以试试127.0.0.1 有可能你loacalhost访问不了mysql。

问题已经解决了 谢谢

声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn核实处理。