Support » Localhost Installs » Only the root MySQL user can access the database

  • Jo Sprague


    I am trying to set up WordPress locally. I had it setup and working before, but I decided I wanted to start fresh, so I wiped everything on my localhost and tried to install everything again. The problem is, when I am trying to configure WordPress to use any MySQL user other than ‘root’, I get the “Error establishing a database connection” message. I’m pretty sure the MySQL user is set up correctly, and with the right permissions, and I’ve triple checked what I’m putting into the wp-config file (the only thing I’m changing is the username and password). I know I could just use ‘root’ since it’s local, but I want to set this up the same on my localhost as on the live server.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Karun


    After you create a new user in database and new database , you need to set permission to the user to all the privileges of the database. Have you done this?

    I’m having the same problem. I created a database, and a user within that database with all privileges. I filled out a wp-config.php with all of my credentials, but I get the same message, “Error establishing a database connection.”

    If I change the username to root and leave the password blank (on a WAMP stack) I am able to log-in to the back-end.

    Why can I log-in using root, but not the database user that I created according to the WP install guide?

    You’ll need to be sure that the user has all the privileges you set on the database you want to use.

    WAMP and MAMP both have phpMyAdmin, so it’s easy to log in, go to the database you want to use and check that the user you created has permission to use that database.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Only the root MySQL user can access the database’ is closed to new replies.