WordPress.org

Forums

[resolved] Error establishing a database connection (7 posts)

  1. Cacklin
    Member
    Posted 2 years ago #

    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?

  2. catacaustic
    very awesome
    Posted 2 years ago #

    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.

  3. Cacklin
    Member
    Posted 2 years ago #

    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

  4. catacaustic
    very awesome
    Posted 2 years ago #

    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.

  5. Cacklin
    Member
    Posted 2 years ago #

    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.

  6. Cacklin
    Member
    Posted 2 years ago #

    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.

  7. catacaustic
    very awesome
    Posted 2 years ago #

    That's not a worry. Hopefully it wil lhelp someone else with the same issue. :)

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.