Skip to content

Commit 8ef3467

Browse files
committed
Add mysql clear password
1 parent 194a01c commit 8ef3467

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
@@ -116,6 +116,8 @@ func (c *Conn) genAuthResponse(authData []byte) ([]byte, bool, error) {
116116
return CalcPassword(authData[:20], []byte(c.password)), false, nil
117117
case AUTH_CACHING_SHA2_PASSWORD:
118118
return CalcCachingSha2Password(authData, c.password), false, nil
119+
case AUTH_CLEAR_PASSWORD:
120+
return []byte(c.password), true, nil
119121
case AUTH_SHA256_PASSWORD:
120122
if len(c.password) == 0 {
121123
return nil, true, nil

mysql/const.go

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ const (
2222
AUTH_NATIVE_PASSWORD = "mysql_native_password"
2323
AUTH_CACHING_SHA2_PASSWORD = "caching_sha2_password"
2424
AUTH_SHA256_PASSWORD = "sha256_password"
25+
AUTH_CLEAR_PASSWORD = "mysql_clear_password"
2526
)
2627

2728
const (

0 commit comments

Comments
 (0)