I wrote a super simple PDO connection:
const DB_HOST = '185.113.196.xxx';
const DB_USER = 'wesley';
const DB_PASS = 'th1s1s4p4ssw0rd';
const DB_NAME = 'flash';
try {
$connection = new PDO(sprintf('mysql:host=%s;dbname=%s', DB_HOST, DB_NAME), DB_USER, DB_PASS);
$connection->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
} catch (PDOException $e) {
die($e->getMessage());
}
This all seems well and good, but when I actually execute a query, the following error pops up:
SQLSTATE[HY000] [1045] Access denied for user 'wesley'@'12-123-12-123.ip.xs4all.nl' (using password: YES)
12.123.12.123 is our Office IP address (in this example), and 12-123-12-123.ip.xs4all.nl is our hostname. How in the world is it possible that that's the address it tries to connect to, instead of the given host?