I've tried looking for this online, but am having trouble finding exactly what I am looking for.
Where I work we have one server that has multiple apache setups on it, all accessed by different subdomains, about 5 total (ex: abc.domain.com, xyz.domain.com, def.domain.com).
Problem is there is one mysql server, on a different physical server we need to connect to, that only allows connection from specific hosts (so say abc.domain.com). Whenever we try to connect to it from PHP, sometimes the login will fail because the user trying to login will come up on a different hostname. (ex user is root@xyz.domain.com, when root@abc.domain.com is the only one allowed). If the page is refreshed a couple time, it will eventually end up using the right hostname to login with and work fine.
My question is, is it PHP on the local server, or MYSQL on the remote server that determines what hostname the user is logging in from.
I know the easiest solution would be to add the other subdomains to the mysql server list of accepted hosts, but I have control over the PHP server, and the MYSQL server is a different department, and it would be much easier to come up with a solution on the PHP side of things.
Thanks