WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Error establishing database connection (6 posts)

  1. 5circles
    Member
    Posted 5 years ago #

    As others have said, I'm sure people are sick of this topic. I'm starting a new one because the most recent I've seen has solved the database connection, but is now on another issue.

    I'm trying to set up a local copy of WordPress on Ubuntu 8.04.

    I downloaded WordPress and set up the files per instructions. I have the wordpress directory in /var/www/worpress, with the ownership as www-data:www-data. Permissions look OK too.

    I set up the MySQL database per instructions, with database called wordpress-private and user wordpress.

    When I try to access the install.php file (either from the Ubuntu machine or across the LAN), I see the 'Error establishing a database connection page'.

    I'm using phpMyAdmin to administer, and some results look odd to me.

    I can access as root, with the password I set up.
    The wordpress user can log on to phpMyAdmin, but only if I don't enter a password. If I enter the password I get an error. (I tried commenting out the DB_PASSWORD line in wp-config.php, but it doesn't make a difference.)

    So it looks like something with the user/password/privileges. The user has default global privileges - which are USAGE - and all access rights to the wordpress database.

    I just tried changing the username/password in wp-config.php to root. This worked. I guess I can limp along for now, but that doesn't seem right.

    Thanks

  2. MichaelH
    Member
    Posted 5 years ago #

  3. 5circles
    Member
    Posted 5 years ago #

    Of course, as soon as I post I try something else that (sort of) works.

    I tried changing the privileges for the wordpress user to Global - ALL. That didn't work. Then I noticed that the host for the wordpress user was set to %. I thought that meant that I could access from anywhere, but apparently not. I changed the host to local, and then the install worked.

    I wish I understood this more, but at least I'm making progress.

  4. 5circles
    Member
    Posted 5 years ago #

    Might review the Step 2: Create the Database and a User section of Installing WordPress.

    I thought I did - went through it several times. I didn't see anything that indicated I needed to change the host for a user. Maybe that's part of the Ubuntu defaults.

  5. moshu
    Member
    Posted 5 years ago #

    Yes, all this thread has nothing to do with WordPress. It is about your struggle to set up your own server, not WP - so it should not even be here!

  6. 5circles
    Member
    Posted 5 years ago #

    Yes, all this thread has nothing to do with WordPress. It is about your struggle to set up your own server, not WP - so it should not even be here!

    With respect, I beg to differ slightly. Yes, it turned out that the problem was with the settings in MySql. But I followed the instructions in the WordPress install (or thought I did), and all that I could see was the error from WordPress.

Topic Closed

This topic has been closed to new replies.

About this Topic