database connect and config