How do I fix the error "Cannot connect to database"?