Go语言入门心法(八): mysql驱动安装报错onnection failed



Go语言入门心法(一): 基础语法

Go语言入门心法(二): 结构体

Go语言入门心法(三): 接口

Go语言入门心法(四): 异常体系

 Go语言入门心法(五): 函数

Go语言入门心法(六): HTTP面向客户端|服务端编程

Go语言入门心法(八): mysql驱动安装报错onnection failed

Go语言入门心法(九): 引入三方依赖

Go语言入门心法(十):Go语言操作MYSQL(CRUD)|事务处理

Go语言入门心法(十一): 文件处理



一: go语言安装mysql驱动报错 


安装最新版mysql驱动:

PS D:\program_file\go_workspace> go install github.com/go-sql-driver/mysql@latest

或者下载远程的mysql启动到本地

PS D:\program_file\go_workspace>go get github.com/go-sql-driver/mysql

报错信息:

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 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值