Welcome Guest, Not a member yet? Register   Sign In
A Database Error
#1

hi i'm new to codeIgniter.
i'm trying to install codeIgniter on my local host (WAMPP) this site is already hosted on my previous website. i have filled all the details which is needed at least i think and I'm getting this error
//
Unable to connect to your database server using the provided settings.
Filename: C:\wamp\www\site\system\database\DB_driver.php
Line Number: 124
//

i've no idea what i missed please provide a solution
thanks in advance

Attached Files Thumbnail(s)
   
Reply
#2

Hi.
Try to configure database connections (file config/database.php). I don't know if you are configured WAMPP.
By default, in WAMPP, the only user allowed to access to a database is "root" without password.
Reply
#3

(04-25-2016, 03:32 AM)casa Wrote: Hi.
Try to configure database connections (file config/database.php). I don't know if you are configured WAMPP.
By default, in WAMPP, the only user allowed to access to a database is "root" without password.
here is my database.php .


$active_group = 'default';
$active_record = TRUE;

$db['default']['hostname'] = 'localhost';
$db['default']['username'] = 'root';
$db['default']['password'] = '';
$db['default']['database'] = 'nda';
$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;
Reply
#4

Here is a small script to test the database connection:

PHP Code:
<?php

// Test MySQLi Connection:
// Fill in connection information.

$dbhost 'localhost';
$dbuser 'root';
$dbpass 'password';
$dbname 'database_name';

$db_conn mysqli_connect($dbhost$dbuser$dbpass$dbname);

// Evaluate the connection
if (mysqli_connect_errno())
{
 
   echo mysqli_connect_error();
 
   exit();
}
else
{
 
   echo "Successful database connection.";

What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#5

thanks !! looks like i set up a password in WAMP so that's it
Thanks
Reply




Theme © iAndrew 2016 - Forum software by © MyBB