CodeIgniter Forums
A Database Error - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: Installation & Setup (https://forum.codeigniter.com/forumdisplay.php?fid=9)
+--- Thread: A Database Error (/showthread.php?tid=65059)



A Database Error - adamrifau - 04-25-2016

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


RE: A Database Error - casa - 04-25-2016

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.


RE: A Database Error - adamrifau - 04-26-2016

(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;


RE: A Database Error - InsiteFX - 04-27-2016

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.";




RE: A Database Error - adamrifau - 05-01-2016

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