fix the mysql read only issue for template controller.