WordPress.org

Support

Support » Installation » [Resolved] Error establishing a database connection

[Resolved] Error establishing a database connection

  • Installing wordpress on mac OSX 10.8.3 using MAMP. Created “wordpress” database. Updated wp-config.php with database – wordpress; user name – root, password – root, host – localhost. MAMP default port settngs at 8888 and 8889; root directory library/webserver/documents/wordpress. when I try to access site at http://localhost:8888/wordpress I get the following error message – The requested URL /wordpress was not found on this server. When I try http://localhost/wordpress/ I get the error message – Warning: mysql_connect() [function.mysql-connect]: Access denied for user ‘root’@’localhost’ (using password: YES) in /Library/WebServer/Documents/wordpress/wp-includes/wp-db.php on line 1141. Does anyone know how to resolve this?

Viewing 6 replies - 1 through 6 (of 6 total)
  • catacaustic

    @catacaustic

    very awesome

    This means that your database connection details are not correct. The first thing that I’d think is that your root password is probably not ‘root’ so that’s something to check. If not use phpMyAdmin to create a new user and assign it to the database. That way you will know the user details as you’ll be the one setting it up.

    Looks at the password, created a new database nothing work. then read that the issue could be I need to replace ‘localhost’ with ‘127.0.0.1’
    now I get the following error message:(even if I change back to ‘localhost’ in the wp-config.php)

    Warning: Cannot modify header information – headers already sent by (output started at /Library/WebServer/Documents/wordpress/wp-config.php:2) in /Library/WebServer/Documents/wordpress/wp-includes/functions.php on line 2741

    catacaustic

    @catacaustic

    very awesome

    That means that whatever you’ve ued to edit the wp-config.php file has left a white-space charater at the very start of that file. Because there’s a space there the server interprets that as output so it can’t send any headers after that point. Check yor wp-config.php file and see what’s there. There’s something at the start of the file.

    Well that part was easy to fix but I’m back to square one. I think it has something to do with the fact that I can’t access using localhost:8888/wordpress. I get the error message – “The requested URL /wordpress was not found on this server.” Whereas I can access myphpadmin via localhost:8888/MAMP. The error message I’m getting when I use localhost/wordpress might be related to a previous install I was attempting before I discovered MAMP.

    Well that was silly. All I needed to do was enter the localhost:8888 without the “wordpress” and it all works fine. Sorry Catacaustic to have taken up your time.

    catacaustic

    @catacaustic

    very awesome

    That’s not a worry. Hopefully it wil lhelp someone else with the same issue. 🙂

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘[Resolved] Error establishing a database connection’ is closed to new replies.
Skip to toolbar