Presumably one or more of the $CFG->dbXXXX settings needs changing in config.php following the migration, example settings:
$CFG->dbhost = 'localhost'; // eg 'localhost' or 'db.isp.com' or IP
$CFG->dbname = 'moodle'; // database name, eg moodle
$CFG->dbuser = 'username'; // your database username
$CFG->dbpass = 'password'; // your database password
Is MySQL on the same server as Moodle? If not there may be a network issue between the Moodle server and the database server such as a firewall blocking access.
If the Moodle server is Linux you can test access from the command line by copying the values from config.php and trying to connect using the mysql client, e.g. for the above settings:
$ mysql -u username -h localhost -p moodle
Enter password: password
If you're still having problems let us know more details including the MySQL version and whether it's on the same server as Moodle.