CodeIgniter数据库连接问题 [英] CodeIgniter Database Connection Issue

查看:282
本文介绍了CodeIgniter数据库连接问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用CodeIgniter,我无法使用我的数据库。我正好关注此教程,但当我打开在localhost我收到一个404页面。

I'm using CodeIgniter, and I'm not able to use my database with it. I'm following this tutorial exactly, but when I open in localhost I receive a 404 page.

推荐答案

您需要设置您的应用程序/ config / database。

You need to set up your application/config/database.

这里您需要为您的数据库添加您的信息。

Here you need to add your information for your database.

$active_group = "default";
$active_record = TRUE;

$db['default']['hostname'] = "localhost";
$db['default']['username'] = "yourdbusername";
$db['default']['password'] = "password_for_db";
$db['default']['database'] = "name_of_db";
$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";

你做过吗?

这篇关于CodeIgniter数据库连接问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆