一: go语言安装mysql驱动报错
安装最新版mysql驱动:
PS D:\program_file\go_workspace> go install github.com/go-sql-driver/mysql@latest
报错信息:
go: github.com/go-sql-driver/mysql@latest: module github.com/go-sql-driver/mysql: Get "https://proxy.golang.org/github.com/go-sql-driver/mysql/@v/list": dial tcp [2404:6800:4012:3::2011]:443: connectex: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
二: 解决方案
PS D:\program_file\go_workspace> go env -w GOPROXY=https://goproxy.cn
再次安装即可
PS D:\program_file\go_workspace> go install github.com/go-sql-driver/mysql@latest
go: downloading github.com/go-sql-driver/mysql v1.7.1
package github.com/go-sql-driver/mysql is not a main package