fix compilation error and fix mysql scripts