Revert "move db connection code into _signin()"

This reverts commit 0df892d4078321ec96dcf69faa9a2e16d143afde.
fix OperationalError: (2006, 'MySQL server has gone away')