If during or after installation, you received "Unable to connect to the database" error, verify that you have entered your MySQL database details correctly. The installation script will not allow you to continue unless the details are correct. The error might be due to writing a password which doesn't exist: you are not expected to create a password for the database during installation.
If the failure occurs after moving your site to another host, check the following items of your configuration.php file. The normal database settings are the following:
var $dbtype = 'mysql'; var $host = 'localhost'; var $user = 'user_with_database_access'; var $db = 'the_actual_database_name'; var $dbprefix = 'table_prefix_';