• When attempting to install, I navigate to:

    https://<myurl>/wp-admin/install.php

    and immediately get:

    Error Establishing Database Connection

    However, an attempt to establish a database connection manually:

    $ mysql -u<wordpressuser> -h<myhostname> -p<mypassword> <databasename>

    Works OK.

    File wp-config.php is correct:

    define(‘DB_NAME’, ‘databasename’);

    /** MySQL database username */
    define(‘DB_USER’, ‘wordpressuser’);

    /** MySQL database password */
    define(‘DB_PASSWORD’, ‘mypassword’);

    /** MySQL hostname */
    define(‘DB_HOST’, ‘myhostname’);

    The only thing of note is that httpd.conf is configured to use virtual hosts, so

    https://<myurl>/&#8230;

    does not match ‘myhostname’.

    Is that a problem? Anything else I’m missing?

Viewing 1 replies (of 1 total)
  • That “Error Establishing Database Connection” can be so frustrating.

    You’ve obviously got the right database name and password, and from wandering around these forums most people get this far and are still tearing their hair out, deleting their databases, usernames and passwords and starting all over again.

    So it is probably because the hostname ‘localhost’, which works in many (most?) instances is incorrect.

    Your hosting company will give you the correct hostname. Or if you have access to a control panel head over to a “databases” section to see if you can find it there. It is not always obvious!

    For example it may be something like:

    mysql-03.some-company.co.uk

    Hope this helps someone

    Pi^2 aka Ecomonkey

Viewing 1 replies (of 1 total)
  • The topic ‘Error Establishing Database Connection’ is closed to new replies.