Connect database with login authentication.