Moved mysql privileges into variable and added LOCK TABLE option for backups