Trouble installing elgg 9.1.3 error message "Unable to connect to the database with these settings."

Hi 

I have attempted several times to install elgg 9.1.3 in a new directory off my htdocs directory.

I have created a database and edited the /engine/setting.php to point to the database.

looking for help on this edit. 

not sure what to put for the following entries>>>>>>

 

/**
 * Defines database credentials.
 *
 * Most of Elgg's configuration is stored in the database.  This file contains the
 * credentials to connect to the database, as well as a few optional configuration
 * values.
 *
 * The Elgg installation attempts to populate this file with the correct settings
 * and then rename it to settings.php.
 *
 * @todo Turn this into something we handle more automatically.
 * @package    Elgg.Core
 * @subpackage Configuration
 */

global $CONFIG;
if (!isset($CONFIG)) {
    $CONFIG = new stdClass;
}

/*
 * Standard configuration
 *
 * You will use the same database connection for reads and writes.
 * This is the easiest configuration, and will suit 99.99% of setups. However, if you're
 * running a really popular site, you'll probably want to spread out your database connections
 * and implement database replication.  That's beyond the scope of this configuration file
 * to explain, but if you know you need it, skip past this section.
 */

/**
 * The database username
 *
 * @global string $CONFIG->dbuser
 */
$CONFIG->dbuser = '{{dbuser}}';     < I TRIED THIS WITH THE BRACKETS AND WITHOUT ALSO WITH THE '  ' AND WITHOUT 

/**
 * The database password
 *
 * @global string $CONFIG->dbpass
 */
$CONFIG->dbpass = '{{dbpassword}}';< I TRIED THIS WITH THE BRACKETS AND WITHOUT ALSO WITH THE '  ' AND WITHOUT 

/**
 * The database name
 *
 * @global string $CONFIG->dbname
 */
$CONFIG->dbname = '{{dbname}}';< I TRIED THIS WITH THE BRACKETS AND WITHOUT ALSO WITH THE '  ' AND WITHOUT 

/**
 * The database host.
 *
 * For most installations, this is 'localhost'
 *
 * @global string $CONFIG->dbhost
 */
$CONFIG->dbhost = '{{dbhost}}';  < I TRIED THIS WITH 'LOCALHOST'  AND JUST localhost

/**
 * The database prefix
 *
 * This prefix will be appended to all Elgg tables.  If you're sharing
 * a database with other applications, use a database prefix to namespace tables
 * in order to avoid table name collisions.
 *
 * @global string $CONFIG->dbprefix
 */
$CONFIG->dbprefix = '{{dbprefix}}';  <NOT SURE IF I SHOULD HAVE ADDED OR CHANGED ANYTHING HERE TRIED IT WITH dbprefix

/**

DO I REMOVE THE '{{AND}}' BRACKETS  AND LEAVE THE ; AT THE END OF THE LINE??? '{{dbhost}}';

 

I have tried it with the brackets '{{     }}' and  without the brackets and with the ' ' WITH NO LUCK 

 

Also not sure what to put in the '{{dbprefix}}' and {{dbhost}}' tried 'dbprefix' and 'localhost' with no results still reports 

  • Unable to connect to the database with these settings.

Any help will be appreciated,

Thanks

Paul 

 

  • please verify the details which you entered is correct or not ..

  • You need to enter the database credentials without the brackets but within the quotation marks:

    $CONFIG->dbuser = 'database_user_name';
    $CONFIG->dbname = 'database_name';
    $CONFIG->dbpass = 'password_for_access';

    If you haven't some unusual server setup it's:

    $CONFIG->dbhost = 'localhost';

    and the default prefix if not entered something else during installation is:

    $CONFIG->dbprefix = 'elgg_';

     

  • As a sidenote:

    if you are making a new installation (instead of moving an existing installation where the database has already been in use), the manual creation of settings.php won't work. Instead you must do the installation in your browser calling the url you have copied the Elgg files to (no setting.php present but the engine folder must be writeable temporarily during installation).

  • Hi iionly,

    Thank you for the information above. I was able to visit the installation and get past the first two setup steps but cannot get by step 3

    3. Database installation

     

    I have created two databases and when I enter the correct Username-Password and DataBase name I am still get this message with either of the new DataBases.

    • Unable to connect to the database with these settings.

    also using these settings

     

    Any suggestions. I activate the install using the DomainName pointing to the elgg folder  and tried the following options

     

    http://SpiritualFamilyNetwork.org     which loads install.php

    and

     http://SpiritualFamilyNetwork.org/install.php     which also loads install.php

     

    I have elgg 1.8.18 already installed in a different folder with a seperate DomainName pointer but it crashed and I cannot acces any of the pages or blogs that were posted to it. http://www.spiritualfamily.net/SFN/activity

    So I am attempting to establish a new installation with ver 1.9.3 but i just noticed the latest released version is 1.9.4 - should I try this release instead?

     

    Also iionly the method I used for installing the files to the folder is to download the elgg zip file to my hard drive - extract the files - import them to the folder I am installing to using expression web for the local copy and then doing an ftp transfer of the files to the server using expression web publish. Do you think that method may be causing problems? In the past I have installed all my Plugins by this method without any problems.

     

    Really stumped here and searching for possible causes.

     

    Thank you for the time you have spent answering these inquiries!

     

     

     

  • I just deleted the folder and reposted the files using elgg 1.9.4 with the same results on the 3rd step with the dataBase

    Elgg

    1. Welcome
    2. Requirements check
    3. Database installation
    4. Configure site
    5. Create admin account
    6. Finished

    Database installation

    • Unable to connect to the database with these settings.

    If you haven't already created a database for Elgg, do that now. Then fill in the values below to initialize the Elgg database.

     

    • ...................

     

    • ...................

     

  • As you have already installed Elgg 1.8 previously I guess you already know that you need to enter the mysql username who has permission to access the database and not the Elgg user. Otherwise I would have thought that this might be the problem even though you think you entered the correct database credentials.

    If you haven't already done so, you might want to try if it helps to change the permissions of the "engine" directory to 777 before starting the installation (not to forget to restore the original permissions after the installation then). The settings.php file that contains the database credentials entered at installation can only be saved if the webserver has write permission in this directory. Maybe the problem is that saving fails and consequently the database connection can't be established because the settings.php file does not exist.

  • Bumping this for an answer. Same issue on 2.2.1

     

  • If it fails on 3 different versions, I would think you got the wrong db credentials. Try using shell access to mysql to see if you can login.

  • db credentials are fine. I setup them up very simple. I dont even get a blank page or wrong info. Just the page refreshes itself everytime.

    I have plenty of accounts on the same server and never had a db issue.