Error establishing a database connection - WordPress


  • | 266 points

    Hi,
    I'm having issues to run my WP site locally. I'm using manageWP as a backup tool and downloaded a full backup from there. Created blank quick app with laragon and extracted the zip file in it and I get the Error establishing a database connection. I am not a developer and have little experience with these things. I just have a small ecommerce site and want to run it locally to make changes. I saw somewhere that it might be the wp_config options but tried everything and it just doesn't load the database. I assume somehow I need to tell laragon that "this is the database to use for this project" but I have no idea from where to do that. I also tried to install fresh local copy of Wordpress using laragon and this worked. Then I tried to copy my backup files to the new folder and all the plugins were turned off and also the database was the fresh and empty one.. Any help would be appreciated!


  • administrators
    | 109642 points

    @geekybg :

    1. You should change your database settings in wp_config.php
    username: root
    password: ''
    database: your-database
    host: localhost
    
    1. Check if your database exists.

    Using root is quick and easy if you are not a developer.


  • | 407 points

    @geekybg usually you need to create database manually on your local environment then change your wordpress configuration like @leokhoa post unless your backup provider give you installer for your backup.


  • | 266 points

    Thanks for your help! I tried many things but again have no idea what I'm doing and why it isn't working. Will try to find someone who can set it up. Thanks again!


  • | 96 points

    I think this tutorial help you to resolve your issue regarding database connection WordPress https://wpitech.com/error-establishing-database-connection-wordpress/


Log in to reply
 

Looks like your connection to Laragon was lost, please wait while we try to reconnect.