Bushra Balharith
Bushra Balharith

Reputation: 51

Error establishing a database connection on localhost xampp os x

i am very beginner in wordpress and want to learn it and the first step was fail :( i tried to install it on localhost (xampp) and this error "Error establishing a database connection" kept shows

i did every step in this video https://www.youtube.com/watch?v=A3fXcvnzlkw

  1. install xampp-osx-5.6.30.
  2. turn on mysql database and apache server.
  3. go to phpmyadmin and add new database name it "wp".
  4. download wordpress 4.7.2
  5. copy the wordpress folder to htdocs then rename it to wp.
  6. go to wp-sample-config rename it to wp-config change the database name to wp, database username to root and database password empty ''.
  7. in the browser localhost/wp/wp-admin/install.php

then the error shows

i tried to add new user in the phpmyadmin and change the wp-config i tried to change the database host from localhost to 127.0.0.1 in wp-config i tried to unistall xampp twice i tried different program mamp nothing helped

my os x version is os x yosemite 10.10.5 should i change any sittings in my computer? is there any programs that i may install it causes the problem? what can i do?

here some photo

wp-config /

Upvotes: 5

Views: 2102

Answers (1)

greenweeds
greenweeds

Reputation: 554

Steps 6 and 7 aren't needed. WordPress creates the wp-config.php file when it discovers that there isn't one there. It prompts you for the database username, password, server (default localhost) and table prefix that you want.

Then it will ask you for some information about the site. Normally that's all you need to do, it will set up wordpress for you from this information. It might not like an empty password for the database user though. If you haven't changed the password you could try root as I think that is the default - root/root

You need to check first that xampp is working correctly though e.g. by outputting a simple html file.

Upvotes: 0

Related Questions