Do you try connecting manually to your db by connection infor u set up in code,
use phpmysql to connect to db first , change phpmysql config file to match the mysql server authentication infor, then ensure all are right before coding anything further.