Have you tried these suggestions in the Installation FAQ (http://docs.moodle.org/en/Installation_FAQ#Error:_database_connection_failed)?
Ken
Hardware and performance
MySQL error
This discussion has been locked because a year has elapsed since the last post. Please start a new discussion topic.