add database and fix mysql syntax