Thursday, November 1, 2012

wordpress - Error establishing a database connection

I once got this error, i checked wp-config.php and found the user/pwd has been typed correctly. So there's no problem with user/pwd, but still the wordpress will show error msg :
'error establishing a database connection'

This is maybe a solution :
- open wp-config.php
- go to the part define('DB_HOST', 'localhost');
- replace 'localhost' with '127.0.0.1:8889'

Cheers.

where is mysql root password ???

MAMP
Application/MAMP/bin/phpMyadmin/config.inc.php
Application/MAMP/bin/mamp/index.php

WORDPRESS
wordpress/wp-config.php