Skip to content

Commit 191e9d7

Browse files
authored
Merge pull request #757 from tirsen/auth-clear-password
Support "mysql_clear_password" auth plugin
2 parents 392e4ca + dfdf3e6 commit 191e9d7

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

client/auth.go

+2
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,8 @@ func (c *Conn) genAuthResponse(authData []byte) ([]byte, bool, error) {
120120
return CalcPassword(authData[:20], []byte(c.password)), false, nil
121121
case AUTH_CACHING_SHA2_PASSWORD:
122122
return CalcCachingSha2Password(authData, c.password), false, nil
123+
case AUTH_CLEAR_PASSWORD:
124+
return []byte(c.password), true, nil
123125
case AUTH_SHA256_PASSWORD:
124126
if len(c.password) == 0 {
125127
return nil, true, nil

mysql/const.go

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ const (
2020
const (
2121
AUTH_MYSQL_OLD_PASSWORD = "mysql_old_password"
2222
AUTH_NATIVE_PASSWORD = "mysql_native_password"
23+
AUTH_CLEAR_PASSWORD = "mysql_clear_password"
2324
AUTH_CACHING_SHA2_PASSWORD = "caching_sha2_password"
2425
AUTH_SHA256_PASSWORD = "sha256_password"
2526
)

0 commit comments

Comments
 (0)