I was able to figure out the issue. The problem was not with the new host. I am using CWP web panel for my website. Lately, they did some changes in their codes which do not allow more than 7 characters in the password field. My old password size was 10. When I created a new database user, I kept the same password, but CWP truncated it to 7 characters. The dbconnect.php file had the old password and hence it was giving the error. I changed the password in dbconnect.php of the pligg system and it fixed the error.