Refactor mysql resource dependencies