Support » Installing WordPress » Error establishing a database connection

  • Resolved curtiskid

    (@curtiskid)


    Is this a common issue when installing wordpress locally? This is the second local install and I am getting the same error. The db settings in wp-config are correct and I can even use those credentials to login to the db on the command line. This makes no sense.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Moderator t-p

    (@t-p)

    Volunteer Moderator

    “Error establishing a database connection” means that there is a problem with the connection to your database
    – a problem with the credentials stored in the wp-config.php file not matching what mysql expects.
    – Try reviewing the following codex for some guidance: http://codex.wordpress.org/Common_WordPress_Errors#Error_Establishing_Database_Connection

    http://codex.wordpress.org/WordPress_Installation_Techniques#Installing_WordPress_Locally

    Thanks for your assistance but this hasn’t helped. I can connect to the db on the command line using the very credentials contained within wp-config.php. This would imply I can login on localhost using any means e.g MySQL Workbench (which, incidentally I can).

    Is there a switch in the php innards that disable db access if failure count exceeds a threshold? Do I have to create a realm of sorts to allow db connectivity from php? I’m lost and it’s not logical.

    Oh and I tried MySQL ‘root’ user credentials and this still didn’t allow access.

    Interesting little bit of information and thank you Apple for not updating php since 5.6!

    I upgraded a very out-of-date php on my brand new mac (how could Apple put old technology onto the latest mbp?). And now we have success.

    Thanks for your input!

    For all those peeps running WordPress locally on a mac, the php included with macOS is old, 5.6. To upgrade to the latest goto this web address: https://jason.pureconcepts.net/2016/09/upgrade-php-mac-os-x/

    • This reply was modified 1 month, 3 weeks ago by curtiskid.
    • This reply was modified 1 month, 3 weeks ago by curtiskid.
    Moderator t-p

    (@t-p)

    Volunteer Moderator

    Glad to know it 🙂

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.