在使用golang连接mysql数据库时需要用到go的数据库连接驱动
github.com/go-sql-driver/mysql
go get -u github.com/go-sql-driver/mysql
可能会出现如下错误
PS E:\Go\practice\PRO1> go get -u github.com/go-sql-driver/mysql
go: module github.com/go-sql-driver/mysql: Get "https://proxy.golang.org/github.com/go-sql-driver/mysql/@v/list": dial tcp 142.251.42.241: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.
go env -w GOPROXY=https://goproxy.cn,direct
go get -u github.com/go-sql-driver/mysql
PS E:\Go\practice\PRO1> go get -u github.com/go-sql-driver/mysql
go: downloading github.com/go-sql-driver/mysql v1.6.0
go: added github.com/go-sql-driver/mysql v1.6.0