上传codeigniter项目时cpanel中的数据库错误 [英] Database error in cpanel while uploading codeigniter project
问题描述
在 cPanel 中上传 CodeIgniter 项目时,发生错误:
While uploading a CodeIgniter project in cPanel, an error occurred:
发生数据库错误
无法使用提供的设置连接到您的数据库服务器.
Unable to connect to your database server using the provided settings.
文件名:core/Loader.php
Filename: core/Loader.php
行号:346
$active_group = 'default';
$active_record = TRUE;
$db['default']['hostname'] = 'localhost';
$db['default']['username'] = 'db user';
$db['default']['password'] = 'password';
$db['default']['database'] = 'db name';
$db['default']['dbdriver'] = 'mysql';
$db['default']['dbprefix'] = '';
$db['default']['pconnect'] = TRUE;
$db['default']['db_debug'] = TRUE;
$db['default']['cache_on'] = FALSE;
$db['default']['cachedir'] = '';
$db['default']['char_set'] = 'utf8';
$db['default']['dbcollat'] = 'utf8_general_ci';
$db['default']['swap_pre'] = '';
$db['default']['autoinit'] = TRUE;
$db['default']['stricton'] = FALSE;
推荐答案
写下用户名和密码的正确细节.您的用户名和密码看起来根本无效.不支持空间**
write the corrects details of the username and password. Your username and password doesnot look valid at all. Space not supported **
$db['default']['hostname'] = 'localhost';
$db['default']['username'] = 'username';
$db['default']['password'] = 'password';
$db['default']['database'] = 'dbname';
$db['default']['dbdriver'] = 'mysqli';
这是要在 config/database.php 中进行的更改
this is the changes to be done in config/database.php
并且不要忘记更改 config.php 中的 base_url 设置
and also dont forget to change the base_url setting in config.php
$config['base_url'] = 'http://yoursitename/foldername';
$config['base_url'] = 'http://yoursitename/foldername';
**
这篇关于上传codeigniter项目时cpanel中的数据库错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!