Skip to content

Commit 11ab1e2

Browse files
author
fmayle
committed
Don't try old auth method on closed conn
1 parent 593ebcf commit 11ab1e2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

driver.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ func (d *MySQLDriver) Open(dsn string) (driver.Conn, error) {
8484
err = mc.readResultOK()
8585
if err != nil {
8686
// Retry with old authentication method, if allowed
87-
if mc.cfg.allowOldPasswords && err == errOldPassword {
87+
if mc.cfg != nil && mc.cfg.allowOldPasswords && err == errOldPassword {
8888
if err = mc.writeOldAuthPacket(cipher); err != nil {
8989
mc.Close()
9090
return nil, err

0 commit comments

Comments
 (0)