执行go get github.com/go-sql-driver/mysql报错如下:

# cd .; git clone https://github.com/go-sql-driver/mysql D:\goproject\src\github.com\go-sql-driver\mysql
    Cloning into 'D:\goproject\src\github.com\go-sql-driver\mysql'...
    fatal: unable to access 'https://github.com/go-sql-driver/mysql/': Failed to connect to github.com port 443: Timed out
    package github.com/go-sql-driver/mysql: exit status 128
 

网上查了下,大概说是网络问题,可是我直接打开https://github.com/go-sql-driver/mysql是可以打开的。

是否我连接的wifi限制了,于是用自己手机的4g网络试试。

> go get github.com/go-sql-driver/mysql

>

成功了,可以下载这个mysql组件包。

 

其实还有其它两个办法:

1、这里https://github.com/go-sql-driver/mysql 直接桌面下载下来 mysql-master, 然后将这个改名成mysql,替换到之前的 src/github.com/go-sql-driver/mysql 老目录,这样后台也跑成了,这个方式有什么隐患吗?

2、使用 go get -u github.com/go-sql-driver/mysql 直接覆盖当前的