add loging for init database
fixed sql init bug