错误位置 FILE: C:\tianhuan\simplewind\Core\Library\Think\Db\Driver\Mysql.class.php LINE: 55
TRACE#0C:\tianhuan\simplewind\Core\Library\Think\Db\Driver\Mysql.class.php(55):E('Unk...
TRACE
#0 C:\tianhuan\simplewind\Core\Library\Think\Db\Driver\Mysql.class.php(55): E('Unknown databas...')
#1 C:\tianhuan\simplewind\Core\Library\Think\Db.class.php(166): Think\Db\Driver\Mysql->connect()
#2 C:\tianhuan\simplewind\Core\Library\Think\Db\Driver\Mysql.class.php(92): Think\Db->initConnect(false)
#3 C:\tianhuan\simplewind\Core\Library\Think\Db\Driver\Mysql.class.php(211): Think\Db\Driver\Mysql->query('SHOW COLUMNS FR...')
#4 C:\tianhuan\simplewind\Core\Library\Think\Model.class.php(130): Think\Db\Driver\Mysql->getFields('th_loucen')
#5 C:\tianhuan\simplewind\Core\Library\Think\Model.class.php(118): Think\Model->flush()
#6 C:\tianhuan\simplewind\Core\Library\Think\Model.class.php(1286): Think\Model->_checkTableInfo()
#7 C:\tianhuan\simplewind\Core\Library\Think\Model.class.php(95): Think\Model->db(0, '', true)
#8 C:\tianhuan\simplewind\Core\Common\functions.php(577): Think\Model->__construct('loucen', '', '')
#9 C:\tianhuan\application\Portal\Action\IndexAction.class.php(73): M('loucen')
#10 [internal function]: Portal\Action\IndexAction->sj()
#11 C:\tianhuan\simplewind\Core\Library\Think\App.class.php(155): ReflectionMethod->invoke(Object(Portal\Action\IndexAction))
#12 C:\tianhuan\simplewind\Core\Library\Think\App.class.php(193): Think\App::exec()
#13 C:\tianhuan\simplewind\Core\Library\Think\Think.class.php(120): Think\App::run()
#14 C:\tianhuan\simplewind\Core\ThinkPHP.php(96): Think\Think::start()
#15 C:\tianhuan\index.php(52): require('C:\\tianhuan\\sim...')
#16 {main}
怎么解决这个问题
网站在本地设置好的,打包压缩然后放到服务器上,就会出现数据库连接不正常的情况,数据库名也对啊,不知道哪里设置有问题
<?php
/**
* 配置文件
*/
return array(
'DB_TYPE' => 'mysql',
'DB_HOST' => 'localhost',
'DB_NAME' => 'tianhuan',
'DB_USER' => 'root',
'DB_PWD' => 'root',
'DB_PORT' => '3306',
'DB_PREFIX' => 'th_',
//密钥
"AUTHCODE" => 'sjjo4s1JZejhrfCyKa',
//cookies
"COOKIE_PREFIX" => 'kMUSN5_',
);
?> 展开
#0 C:\tianhuan\simplewind\Core\Library\Think\Db\Driver\Mysql.class.php(55): E('Unknown databas...')
#1 C:\tianhuan\simplewind\Core\Library\Think\Db.class.php(166): Think\Db\Driver\Mysql->connect()
#2 C:\tianhuan\simplewind\Core\Library\Think\Db\Driver\Mysql.class.php(92): Think\Db->initConnect(false)
#3 C:\tianhuan\simplewind\Core\Library\Think\Db\Driver\Mysql.class.php(211): Think\Db\Driver\Mysql->query('SHOW COLUMNS FR...')
#4 C:\tianhuan\simplewind\Core\Library\Think\Model.class.php(130): Think\Db\Driver\Mysql->getFields('th_loucen')
#5 C:\tianhuan\simplewind\Core\Library\Think\Model.class.php(118): Think\Model->flush()
#6 C:\tianhuan\simplewind\Core\Library\Think\Model.class.php(1286): Think\Model->_checkTableInfo()
#7 C:\tianhuan\simplewind\Core\Library\Think\Model.class.php(95): Think\Model->db(0, '', true)
#8 C:\tianhuan\simplewind\Core\Common\functions.php(577): Think\Model->__construct('loucen', '', '')
#9 C:\tianhuan\application\Portal\Action\IndexAction.class.php(73): M('loucen')
#10 [internal function]: Portal\Action\IndexAction->sj()
#11 C:\tianhuan\simplewind\Core\Library\Think\App.class.php(155): ReflectionMethod->invoke(Object(Portal\Action\IndexAction))
#12 C:\tianhuan\simplewind\Core\Library\Think\App.class.php(193): Think\App::exec()
#13 C:\tianhuan\simplewind\Core\Library\Think\Think.class.php(120): Think\App::run()
#14 C:\tianhuan\simplewind\Core\ThinkPHP.php(96): Think\Think::start()
#15 C:\tianhuan\index.php(52): require('C:\\tianhuan\\sim...')
#16 {main}
怎么解决这个问题
网站在本地设置好的,打包压缩然后放到服务器上,就会出现数据库连接不正常的情况,数据库名也对啊,不知道哪里设置有问题
<?php
/**
* 配置文件
*/
return array(
'DB_TYPE' => 'mysql',
'DB_HOST' => 'localhost',
'DB_NAME' => 'tianhuan',
'DB_USER' => 'root',
'DB_PWD' => 'root',
'DB_PORT' => '3306',
'DB_PREFIX' => 'th_',
//密钥
"AUTHCODE" => 'sjjo4s1JZejhrfCyKa',
//cookies
"COOKIE_PREFIX" => 'kMUSN5_',
);
?> 展开
展开全部
第一行写着,Unknown database。
就是说数据库的配置有问题,数据库的库名写错了。
你检查一下,我曾通犯过敏颂个错误,就是库名打多了个空格,检查了好久才发现。
-------------------------------------------------------------------------------
在index.php加设置define('APP_DEBUG', true);
然后进入Application\Runtime\Logs,把对桥败郑就model的错误日志发过来分枯举析才行。
就是说数据库的配置有问题,数据库的库名写错了。
你检查一下,我曾通犯过敏颂个错误,就是库名打多了个空格,检查了好久才发现。
-------------------------------------------------------------------------------
在index.php加设置define('APP_DEBUG', true);
然后进入Application\Runtime\Logs,把对桥败郑就model的错误日志发过来分枯举析才行。
追问
这个问题解决不了,后来搜的程序员只作参考
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询