since upgrading to 2.6.3 I'm getting alot of "error establishing a database connection" messages.
so many, in fact, I can't get enough successive connects to turn off plugins.
the db seems fine in the godaddy control panel and I can connect with the code supplied by otto42 above.
obviously, the wp-config.php file is not the prob as I sometimes connect.
upgraded to 2.7 and I have the same problem...occasionally connecting.
I saw a comment somewhere that an underscore in the db (4.1) name could be causing the problem. I have 3 wp blogs going and only having prob with one...the one with the underscore.
any suggestions, anyone?
thanks in advance