If I have MySQL running on a Linux box, is it faster to run queries if connected to localhost than if I connect to a domain which resolves to the same box? This is from Java
localhost is a domain that resolves to your computer, so I'd say that it's exactly as fast.
localhost
Using a file socket might bring in a difference, though I don't know if JDBC supports it.