make script idempotent and fix mysql password