Merge pull request #419 from methane/fix/mysql-5.1
Fix auth fail on MySQL 5.1
This commit is contained in:
@@ -1051,7 +1051,6 @@ class Connection(object):
|
|||||||
|
|
||||||
def _request_authentication(self):
|
def _request_authentication(self):
|
||||||
# https://dev.mysql.com/doc/internals/en/connection-phase-packets.html#packet-Protocol::HandshakeResponse
|
# https://dev.mysql.com/doc/internals/en/connection-phase-packets.html#packet-Protocol::HandshakeResponse
|
||||||
self.client_flag |= CLIENT.CAPABILITIES
|
|
||||||
if int(self.server_version.split('.', 1)[0]) >= 5:
|
if int(self.server_version.split('.', 1)[0]) >= 5:
|
||||||
self.client_flag |= CLIENT.MULTI_RESULTS
|
self.client_flag |= CLIENT.MULTI_RESULTS
|
||||||
|
|
||||||
@@ -1073,7 +1072,7 @@ class Connection(object):
|
|||||||
data = data_init + self.user + b'\0'
|
data = data_init + self.user + b'\0'
|
||||||
|
|
||||||
authresp = b''
|
authresp = b''
|
||||||
if self._auth_plugin_name == 'mysql_native_password':
|
if self._auth_plugin_name in ('', 'mysql_native_password'):
|
||||||
authresp = _scramble(self.password.encode('latin1'), self.salt)
|
authresp = _scramble(self.password.encode('latin1'), self.salt)
|
||||||
|
|
||||||
if self.server_capabilities & CLIENT.PLUGIN_AUTH_LENENC_CLIENT_DATA:
|
if self.server_capabilities & CLIENT.PLUGIN_AUTH_LENENC_CLIENT_DATA:
|
||||||
|
|||||||
Reference in New Issue
Block a user