Connect to localhost on the VM

Connecting to db.$DOMAIN leads us to have to configure all users to connect from an external host and to open up the MySQL database to the world, which you may not want.