0

I had downloaded XAMPP software for wordpress. After downloading, the wordpress started giving Data Base Connection Error when I tried to enter username and password. So I decided to uninstall XAMPP and downloaded WAMP server.

Now, after downloading it, I am unable to go into localhost/wordpress and it is showing the 'error establishing database connection'. It's pretty frustrating.

Please help...

Cheers.

4
  • Well, did you setup your database and did you set up the database parameters in the config file? You didn't really explain what you did except for installing the web server. Commented Oct 1, 2016 at 21:11
  • I had setup config.php file in wordpress and changed the name and username as well but the result was the same. When I typed localhost/wordpress after installing WAMP, it appears XAMPP icon in the search bar instead of WAMP. Commented Oct 1, 2016 at 21:26
  • There are four fields you must set in wp-config.php -- DB_NAME, DB_PASSWORD, DB_USER, and DB_HOST. Did you set all the appropriate values for those items? DB_HOST is likely going to be "localhost", but of course the other three items are going to vary depending on your username / password / database name Commented Oct 2, 2016 at 1:54
  • I had set the DB name and username as well.. But didn't set the password. The password was left just blank. As I've mentioned earlier, when I open localhost/wordpress, I get to see Xampp icon on the top bar menu instead of Wamp. Commented Oct 2, 2016 at 7:26

2 Answers 2

0

You find many tutorials regarding same online . But my probleam was due to attack on one of my xmlrpc file . Just block the ip that is requesting xmlrpc . Also this was helpful Link

Sign up to request clarification or add additional context in comments.

Comments

0

I think I may have figured this out. Everytime I start a new build in Wamp I got the error establishing connection to database. First, establish the database and THEN import the WordPress files. On the wp-config.php file (which you created by copying the wp-config-sampl.php file and deleting the "-sample" part, enter the name of the database you established here: define('DB_NAME', 'youdatabase'); where it reads 'youdatabase'.

Since the default username is 'root' and the password is blank, then the username is 'root' where it reads define('DB_USER', 'root'); and the password line should look like this: define('DB_PASSWORD', '');

Refresh the browser and then you should be led to complete the installation on your local host.

This could be the 1200th time that the answer has been posted, but maybe this will help.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.