Support » Localhost Installs » Unzip wordpress.zip results in Error establishing a database connection

  • Eric Hepperle

    (@codeslayer2010)


    I ran into a strange error this morning and didn’t find any answers as I searched the forums.

    Immediately after unzipping either wordpress-6.0.1.zip or wordpress-5.9.1.zip, when I launch the localhost path where the WordPress installation page should show up in Chrome browser, I instead get this error message:

    “Error establishing a database connection”

    This is strange because I haven’t even set up a database yet. BTW, I’m using Wampserver 3.2.6 64-bit on Windows 7.

    I haven’t even installed the site yet — I’m trying to bring the installer up, but it gives me that database error. Here are some things I’ve tried already:

    – Cleared browser history/cache
    – Restarted web server
    – Created a database first as in step 2 (The DB doesn’t usually need to be created until you get to the point in the install where it asks for db connection info): https://wordpress.org/support/article/how-to-install-wordpress/
    – Tried different database names
    – Tried different folder names
    – Tried different versions of wordpress.zip
    – Tried different folder depths

    Another interesting quirk is that when I unzipped the wordpress.zip folder and left it nested two levels deep (wordpress-6.0.1/wordpress) the installer came up fine. But, not every time. But, when I renamed the folder and moved the files from the “wordpress” folder up one level (eg instead of “wordpress-6.0.1/wordpress”, “johnsite/”) I get the database error again.

    – All previously installed WordPress websites on my localhost are working fine, so my guestimation is that my Wampserver is not the problem

    Have any of you experienced this weird problem? I am not sure what to make of it. It is preventing me being able to install on localhost.

    Thanks in advance for your assistance!

Viewing 1 replies (of 1 total)
  • Check the folder ABOVE the WordPress installation.

    For johnsite/, that would be [parent-folder]/johnsite/

    And for wordpress-6.0.1/wordpress, that would be [parent-folder]/wordpress-6.0.1/wordpress

    Is there a wp-config.php file in this parent folder?

    I’m asking because WordPress supports placing the configuration file one directory up outside the WordPress root.

    And your issue seems to suggest the installer is detecting a wp-config.php elsewhere, and the only place WordPress will find it is if it’s one directly above the root of the WordPress installation in question.

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