Welcome Guest, Not a member yet? Register   Sign In
A Database Error Occurred Unable to connect to your database server using the provided settings.
#1

[eluser]Unknown[/eluser]
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";
#2

[eluser]theprodigy[/eluser]
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.
#3

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

Happy coding,
DesignFellow




Theme © iAndrew 2016 - Forum software by © MyBB