Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

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

August 06, 2009 2:48am

Subscribe [3]
  • #1 / Aug 06, 2009 2:48am

    Kavitha

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

  • #2 / Aug 06, 2009 1:29pm

    theprodigy's avatar

    theprodigy

    653 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.

  • #3 / Aug 07, 2009 3:12am

    designfellow's avatar

    designfellow

    61 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

ExpressionEngine News

#eecms, #events, #releases