fix mysql script for document