Make mysql template slightly more flexible