Fixing mysql scripts