mysql to scrpt