I've seen many posts regarding the infamous "Error establishing a database connection" Many seemed related to the hosting company and their setup or technical issues. I'm having the same problem, but not related to the hosting company as I am hosting my own server.
I tried installing WordPress using the install.php which did not result in wp-config being created. I then edited wp-config.php manually and uploaded to the server. I know for a fact mySQL is up and running and serving other sites. I know for a fact the username / password / database name / database address are correct. I think the password in wp-config.php should probably not be in clear text, but it didn't work even when I copied the encrypted password from the database.
Any suggestions will be very appreciated.