Error establishing a database connection - Wordpress

September 14, 2015 5k views
WordPress MySQL

Mysql is running.

I have dropped my original database and made another, then changed the details in my wp-config.html.

I'm still getting an error, and when I try to add the repair line and go to /wp-admin/maint/repair.php, I still get the error.

Any ideas?

I followed everything in the following tutorials:

  • When you replaced the database did you update the user account to have permissions for the new table? The user defined in our one-click by default only has access to the WordPress database.

  • I dropped the database completely and just did these steps again:

    CREATE DATABASE wordpress;
    CREATE USER wordpressuser@localhost IDENTIFIED BY 'password';
    GRANT ALL PRIVILEGES ON wordpress.* TO wordpressuser@localhost;

    I've just tried to give my username privileges from root, and that work, but if I do it signed in as the user it says "Access denied".

  • I've just installed phpmyadmin, and created the database and user from scratch and update my wp-config.php and it still isn't working.

    I've tried restarting my server and mysql but no change.

    The repair file is still getting a database connection error too.

    Am I right in thinking the database should be empty because it's the next steps that add the "wp_" tables in?

Be the first one to answer this question.