Getting data from remote mysql into a local file