Heim  >  Artikel  >  Backend-Entwicklung  >  求帮忙,无法数据库加载驱动,这问题怎么解决

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

WBOY
WBOYOriginal
2016-06-20 12:57:301100Durchsuche

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'   => 3306, 

);












:(
无法加载数据库驱动: Think\Db\Driver\
错误位置
FILE: E:\ThinkPHP\ThinkPHP\Library\Think\Db.class.php  LINE: 42
TRACE
#0 E:\ThinkPHP\ThinkPHP\Library\Think\Db.class.php(42): E('\xE6\x97\xA0\xE6\xB3\x95\xE5\x8A\xA0\xE8\xBD\xBD\xE6\x95\xB0...')
#1 E:\ThinkPHP\ThinkPHP\Library\Think\Model.class.php(1423): Think\Db::getInstance('')
#2 E:\ThinkPHP\ThinkPHP\Library\Think\Model.class.php(97): Think\Model->db(0, '', true)
#3 E:\ThinkPHP\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\ThinkPHP\Library\Think\App.class.php(164): ReflectionMethod->invoke(Object(Home\Controller\IndexController))
#7 E:\ThinkPHP\ThinkPHP\Library\Think\App.class.php(205): Think\App::exec()
#8 E:\ThinkPHP\ThinkPHP\Library\Think\Think.class.php(120): Think\App::run()
#9 E:\ThinkPHP\ThinkPHP\ThinkPHP.php(97): Think\Think::start()
#10 C:\xampp\htdocs\app\index.php(24): require('E:\\ThinkPHP\\Thi...')
#11 {main}


回复讨论(解决方案)

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

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

问题已经解决了 谢谢

Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn