Skip to content

Commit 6ff8753

Browse files
authored
feat: Add MySQL caching_sha2_password support for the proxy clients using unix sockets. (#2489)
Automatically set the MDX client_protocol_type field to "TCP" or "UDS" for mysql instances that support Metadata Exchange. This will ensure that password login works correctly in MySQL 8.0 or higher when the user has a caching_sha2_password. We will leave this in a draft state until back-end support for this is fully rolled out. Fixes #2317
1 parent f537bfb commit 6ff8753

File tree

7 files changed

+5
-6
lines changed

7 files changed

+5
-6
lines changed

internal/proxy/fuse.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
// limitations under the License.
1414

1515
//go:build !windows && !openbsd && !freebsd
16-
// +build !windows,!openbsd,!freebsd
1716

1817
package proxy
1918

internal/proxy/fuse_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
// limitations under the License.
1414

1515
//go:build !windows && !darwin
16-
// +build !windows,!darwin
1716

1817
package proxy_test
1918

internal/proxy/proxy.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,11 @@ func dialOptions(c Config, i InstanceConnConfig) []cloudsqlconn.DialOption {
297297
default:
298298
// assume public IP by default
299299
}
300+
if networkType(&c, i) == "unix" {
301+
opts = append(opts, cloudsqlconn.WithMdxClientProtocolType("uds"))
302+
} else {
303+
opts = append(opts, cloudsqlconn.WithMdxClientProtocolType("tcp"))
304+
}
300305

301306
return opts
302307
}

internal/proxy/proxy_other.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
// limitations under the License.
1414

1515
//go:build !windows && !openbsd && !freebsd
16-
// +build !windows,!openbsd,!freebsd
1716

1817
package proxy
1918

internal/proxy/proxy_other_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
// limitations under the License.
1414

1515
//go:build !windows
16-
// +build !windows
1716

1817
package proxy_test
1918

internal/proxy/unix.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
// limitations under the License.
1414

1515
//go:build !windows
16-
// +build !windows
1716

1817
package proxy
1918

main.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
// limitations under the License.
1414

1515
//go:build !windows
16-
// +build !windows
1716

1817
package main
1918

0 commit comments

Comments
 (0)