【发布时间】:2016-12-15 05:39:30
【问题描述】:
我正在尝试将网站上传到服务器。 Code Igniter 是我在这个网站上使用过的框架,也是我第一次使用 CI。在尝试使用以下数据库设置将网站上传到服务器时:
$db['default'] = array(
'dsn' => 'mysql:host=localhost;dbname=database_name',
'hostname' => 'mysql:host=localhost',
'username' => 'database_user',
'password' => 'database_password',
'database' => 'database_name',
'dbdriver' => 'pdo',
'dbprefix' => '',
'pconnect' => FALSE,
'db_debug' => (ENVIRONMENT !== 'production'),
'cache_on' => FALSE,
'cachedir' => '',
'char_set' => 'utf8',
'dbcollat' => 'utf8_general_ci',
'swap_pre' => '',
'encrypt' => FALSE,
'compress' => FALSE,
'stricton' => FALSE,
'failover' => array(),
'save_queries' => TRUE
);
我遇到以下错误,我尝试在网上搜索以解决我的问题。我发现了一些与我的问题相似的问题,但我不知道我应该做什么,因为大多数问题都是针对本地服务器的。请有人帮我解决一下谢谢。
A Database Error Occurred
SQLSTATE[HY000] [2054] The server requested authentication method unknown to the client
Filename: controllers/Home.php
Line Number: 9
A PHP Error was encountered
Severity: Warning
Message: PDO::__construct(): The server requested authentication method unknown to the client [mysql_old_password]
Filename: pdo/pdo_driver.php
Line Number: 133
Backtrace:
编辑:
【问题讨论】:
标签: mysql database codeigniter