MAMP WordPress and Error establishing a database connection

I’ve installed MAMP on my Mac to do some changes to my blog. I tried to set the WordPress wp-config.php file to connect to localhost:8889, but got an error that It could not connect to the database. After replacing localhost:8889 to 127.0.0.1:8889 it works. My quick guess is that permissions for the root user is set to allow connections 127.0.0.1, but not localhost. Anyway, it works now.

My wp-config.php file looks like this:

define('DB_NAME', 'wordpress'); /** MySQL database username */

define(‘DB_USER’, ‘root’);

/** MySQL database password */

define(‘DB_PASSWORD’, ‘root’);

/** MySQL hostname */

define(‘DB_HOST’, ’127.0.0.1:8889′);


Related posts:

  1. Ecto, WordPress and time zones
  2. WordPress 1.5
  3. Updated to WordPress 1.2
  4. Ecto
  5. ecto

4 thoughts on “MAMP WordPress and Error establishing a database connection

  1. Actually it did establish the connection to the database but it now says “WPMU only works without the port number in the URL.”

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>