Well, it seems you got everything right. You need to insert the new database name and password in wp-config.php .
But what exactly doesn't work? Maybe your site needs to have all the permissions set as on the old hosting?
Set everything up exactly as on the old one. If you have shared hosting, public_html = httpdocs, so no worries about that.