connect to given database from config