So I'm trying to connect remotely to a database hosted on godaddy. I'm getting a 1045 error everytime. During troubleshooting I went back to my code hosted locally and tried changing the hostname from "localhost" to the servers ip address... this resulted in 1045 error as well. I've verified that the ip address is indeed correct. The database is hosted on a godaddy shared hosting account. I've ran thru all the troubleshooting with them and they can't get me a hostname that will work leaving me to believe the issue is with the mysql or cpanel user only being assigned to "localhost". Any ideas on how to resolve this? The first line of code works, the second does not.
$db = new PDO('mysql:host=localhost;port=3306;dbname=name;charset=UTF8', 'user', 'pw', array(PDO::ATTR_EMULATE_PREPARES => false));
$db = new PDO('mysql:host=100.100.100.1;port=3306;dbname=name;charset=UTF8', 'user', 'pw', array(PDO::ATTR_EMULATE_PREPARES => false));