EllisLab text mark
Advanced Search
     
A Database Error Occurred Unable to connect to your database server using the provided settings.
Posted: 06 August 2009 02:48 AM
Joined: 2009-08-06
1 posts

Hi,
Got this error on the connecting to codiginter and postgresql . on my localhost it’s working. I’m sure that my config is right but still not working.Can you solve this problem?

A Database Error Occurred
Unable to connect to your database server using the provided settings.

database.php
active_group = “default”;
$active_record = TRUE;

$db[‘default’][‘hostname’] = “localhost”;
$db[‘default’][‘username’] = “username”;
$db[‘default’][‘password’] = “password”;
$db[‘default’][‘database’] = “databasename”;
$db[‘default’][‘dbdriver’] = “postgre”;
$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”;

 
Posted: 06 August 2009 01:29 PM   [ # 1 ]   [ Rating: 0 ]
Avatar
Joined: 2008-11-18
678 posts

you said it’s working on your localhost, I’m assuming you ftp’d the site up to a server. Are you using shared hosting? Check the dbname, sometimes the hosting companies like to add prefixes to database names and user names

If you ask for dbname “database”, many of them will create “sitename_database” or something similar. The same is true for the user accessing the database.

Check these, you may need to alter your database config file a little.

 Signature 

Quality Coder | Looking for work? | Logo by InsiteFX

 
Posted: 07 August 2009 03:12 AM   [ # 2 ]   [ Rating: 0 ]
Avatar
Joined: 2009-03-27
67 posts

Check your hostname, db prefix.
By setting this correct, your problem will be solved.
No other issues can create this error.

Happy coding,
DesignFellow

 Signature 

Download CodeIgniter 2.0 Cheat Sheet http://www.mmyo.me/30

More CodeIgniter Related Resources : http://www.memeyo.com/groups/codeigniter