re-authenticate and re-select database when disconnect
reconnecting without auth when sending auth command to avoid overflow error
Refactoring fix in authentication on disconnect