I just got a new Macbook Air and I've been manually migrating my files and code over from my old Macbook (instead of using Migration Assistant, to avoid bringing cruft).
I had several sites running Wordpress locally (on my old Macbook), as well as several sites running just statically with no CMS.
I think I've gotten Apache and MySQL all configured (installed MySQL on the new Mac with Homebrew, and using Sequel Pro to admin it) correctly, but I keep getting the "Error establishing a database connection" for all of my Wordpress sites.
The static sites are running on their local domains just fine, so that's why I think I have Apache and relevant files set up correctly (hosts, httpd.conf, httpd-vhosts.conf all just copied over from the old machine). And, I have the wp-config.php files matched up correctly with the MySQL db's, users and pw's.
So what on earth am I missing that's giving me this error on all my Wordpress installs??