How To Install WordPress using Wamp Server Without Error Establishing a Database Connection

How To Install wordpress Locally with WAMP Server

Do you know you can save more money and time by using WordPress locally with the Wamp Server? Yes, We can do all the experiment  in our theme, css and everything without messing up with our Hosting server.

But most of them fails and end up in “Error Establishing a Database Connection” Here we have covered that Error issue and come up with the bright solution.

Here we Go!

 Install WordPress using Wamp Server Without Error Establishing a Database Connection

Required Tools:

Download WordPress
Download Wamp Server of your choice
Download Wamp Server 32 bit
Download Wamp server 64 Bit

 

Install Wamp Server

Now Install the Wamp Server on your local Drive.

If you are Novice, after Installing Make Sure all the services are Running.  Its Easy to find its running or not Just check the bight bottom icon near your system time and date.

wamp

Wamp Icon

 
Orange Indicates – Initiating Local Host on the RAM
Red Indicated – All your service is On Offline/Ended
Green Indicates –  All your services are Online and Running

 

If your Wamp or Local host is not working, Sign out or Quit Applications like Skype,  Gtalk and try again.

Now Transfer all your sites to this location “ C:\wamp\www ” and check using local host

Instead of URl in browser type “Local Host” to see your list of sites in local host.

 

Creating DataBase For WordPress Using WampServer

Unlike simple HTML website, WordPress needs a database to store all the site information.

Now unzip the wordpress in this location ” C:\wamp\www ” and

Go to Localhost and click PHPmyAdmin in Tools Session.

Follow the Image below

PHPmyadmin

PHPmyadmin In Localhost Tools

 

Now its time to create Database for your wordpress.

Click DataBase as given image below

Install WordPress using Wamp Server

Create Database WordPress using Wamp Server

 

provide a DataBase Name to create WP-Database, No more change requires at this time.

wp2

Created DataBase

After Creating DataBase

 

wp3

Sucessfully DataBase Created

Providing DataBase WP Configuration

 

Now open WordPress folder and find wp-config-sample.php file and rename it to wp-config.php or you can make a copy of wp-config-sample.php and rename 2nd wp-config-sample.php, because we need to enter database information in wp-config.php file and if you will make any typing mistake WordPress won’t install.

Open wp-config.php file in text editor e.g. notepad don’t use Microsoft Word to edit wp-config.php or any other WordPress file, because Microsoft Word will add extra code to these files and files won’t work.

Find following lines

// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define('DB_NAME', 'database_name_here');

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

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

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

and replace database_name_here with your database name, in my case my database name is “wordpress”, replace username_here with ‘root’, that is default user name for WAMP server and just remove password_here because password is blank for WAMP server. MySQL host will remain localhost.

After adding necessary information above lines should look like this.


// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define('DB_NAME', 'wordpress');

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

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

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

Click the created DataBase and go for Privillage Option from the menu Bar.

Please Enter the Information of what you provided in the “wp-config.php”

 

If you find difficulties in configuring “wp-config.php”

Download here i have made it for you. But the Database name is prelisted in the name of “elitefox”.

Click the link to download wp-config.php

wp4

Add Users

 

Now Provide All your login Information as given in the Image below.

wp5

Config the Login Information

wp6

Check All in global Privileges

wp7

Now Everything Is Fine

wp8

create the WordPress Admin Dashboard Information And Rock on

wp9

Your DashBoard “Ta – Da”

Now Go to The LocalHost and test your WordPress Site
Thank you for reading this article and Please consider sharing.

If its help you in installing sucessfully, consider adding comment and feedback. Feel free to ask any thing related
Install WordPress using Wamp Server Without Error Establishing a Database Connection” I am ready to help you with in 6 hrs, if you have any doubt or error occurs.

Author: I.G.Pradeep

Responsive Web Designer, SEO and Software Developer at Bangalore. Passionate Blogger and Entrepreneur. Passionate @ Science, Technology, Comics and more. i.g.pradeep@elitefox.org +91 - 889 - 247 - 0758

Share This Post On

12 Comments

  1. it was really of great help to me. thanks a lot.

    Post a Reply
    • You ‘re welcome :)

      Post a Reply
  2. Hi. I downloaded WAMP and WordPress on my Win 7 laptop and I’m getting the error message “Error establishing database connection”. I’ve tried 2 different ways–by editing the wp-config.php file as you’ve shown and also by deleting the wp-config file and letting WP generate one. Still I get the same error. Any suggestions?

    Post a Reply
    • OK. I was just able to solve this. for some reason, WP didn’t like any user name other than ‘root’. When I changed this to ‘root’ and left the password blank in the config file, it worked.

      Post a Reply
  3. great help! thanks a bunch..

    Post a Reply
    • Hi. I downloaded WAMP and WordPress on my Win 7 laptop and I’m getting the error message “Error establishing database connection”. I’ve tried 2 different ways–by editing the wp-config.php file as you’ve shown and also by deleting the wp-config file and letting WP generate one. Still I get the same error. When I changed this to ‘root’ and left the password blank in the config file, Still I get the same error.
      Any suggestion?

      Post a Reply
  4. This helps a lot! Thanks so much!

    Post a Reply
    • Hi,

      In 1st case, I installed Wamp server in C:, WordPress configured. I don’t want to keep database in C: so I installed Wamp Server in other drive and recreated database and facing same issue i.e. Error Establishing a Database Connection while configuring WordPress.

      Is Wamp Server C: drive specific? If Wamp Server is C: specific, please help me to fix it so that I can install and configure Wamp Server and WordPress in other drive.

      Post a Reply
      • Hello UV IT Sys,

        Wamp Server drive specific, Only works on C;
        You cannot change it to other. It wont work.
        Are you still getting this error in C;
        Please let me know. Thanks

        Post a Reply
        • Hi,

          1st of all. Thank you for replying me for my post.

          Please allow me to elaborate the issue 1st.
          In 1st case, I installed Wamp Server in C: (by default). And then configured WordPress. It configured well.

          As I explained, I don’t want to keep all them in C: so I uninstalled Wamp Server and deleted everything. Then I reinstalled Wamp Server and this time I selected another drive for installing Wamp Server. Then I tried to configure WordPress in the same drive and with same way but its failed with error message ‘Error Establishing a Database Connection’.

          Please help me to fix it so that I can install and configure Wamp Server and WordPress in other drive.

          Post a Reply

Submit a Comment

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>