Go丨语言package github.com/Go-SQL-Driver/MySQL: exec: "git": executable file not found in %PATH%解决方法
2017-02-23 17:27
821 查看
Go语言在添加第三方MySQL驱动的时候报错:
go: missing Git command. See https://golang.org/s/gogetcmd
package github.com/Go-SQL-Driver/MySQL: exec: "git": executable file not found in %PATH%
根据以上报错语句可以看出来是没有找到%PATH%
missing Git command[b]:说明实在执行获取资源命令的时候报的错,那么我们如何解决呢?[/b]
[b]1、看你的C:盘有没有GOPATH这个目录 ,没有的话手动创建一个GOPATH目录,[/b]
[b]2、创建好后再次执行[/b] go get github.com/Go-SQL-Driver/MySQL 命令,执行完成后查看GOPATH下面是否有src目录和pkg目录 ,
没有的[b]src目录和pkg目录 就需要配置一下环境变量 ,在环境变量里面添加一个变量名为:GOPATH ,变量值为:C:\GOPATH\ 再次执行,可能还是会同样的错误,怎么办呢?[/b]
3、以上步骤执行完后,查看C:\GOPATH\src\github.com\Go-SQL-Driver 这个目录下有没有 MySQL目录,没有就创建一个MySQL目录,
并且去https://github.com/Go-SQL-Driver/MySQL 这个地址下载MySQL驱动go语言些的源文件 解压放入MySQL文件夹下面。
4、再次执行 go get github.com/Go-SQL-Driver/MySQL [b]命令,[/b]
[b]查看[/b]C:\GOPATH\pkg\windows_386\github.com\Go-SQL-Driver和C:\GOPATH\pkg\windows_amd64\github.com\Go-SQL-Driver目录下面有没有MySQL.a文件,有[b]就ok了。[/b]
博文到此结束,感谢您的观看,希望对各位读者有所帮助,如果有什么意见以及建议请在评论留言......
======祝各位读者生活愉快======
go: missing Git command. See https://golang.org/s/gogetcmd
package github.com/Go-SQL-Driver/MySQL: exec: "git": executable file not found in %PATH%
根据以上报错语句可以看出来是没有找到%PATH%
missing Git command[b]:说明实在执行获取资源命令的时候报的错,那么我们如何解决呢?[/b]
[b]1、看你的C:盘有没有GOPATH这个目录 ,没有的话手动创建一个GOPATH目录,[/b]
[b]2、创建好后再次执行[/b] go get github.com/Go-SQL-Driver/MySQL 命令,执行完成后查看GOPATH下面是否有src目录和pkg目录 ,
没有的[b]src目录和pkg目录 就需要配置一下环境变量 ,在环境变量里面添加一个变量名为:GOPATH ,变量值为:C:\GOPATH\ 再次执行,可能还是会同样的错误,怎么办呢?[/b]
3、以上步骤执行完后,查看C:\GOPATH\src\github.com\Go-SQL-Driver 这个目录下有没有 MySQL目录,没有就创建一个MySQL目录,
并且去https://github.com/Go-SQL-Driver/MySQL 这个地址下载MySQL驱动go语言些的源文件 解压放入MySQL文件夹下面。
4、再次执行 go get github.com/Go-SQL-Driver/MySQL [b]命令,[/b]
[b]查看[/b]C:\GOPATH\pkg\windows_386\github.com\Go-SQL-Driver和C:\GOPATH\pkg\windows_amd64\github.com\Go-SQL-Driver目录下面有没有MySQL.a文件,有[b]就ok了。[/b]
博文到此结束,感谢您的观看,希望对各位读者有所帮助,如果有什么意见以及建议请在评论留言......
======祝各位读者生活愉快======
相关文章推荐
- Hive学习2_错误: The specified datastore driver ("com.mysql.jdbc.Driver") was not found in the CLASSPATH
- 调试go语言出现:exec: "gcc": executable file not found in %PATH%
- exec: "hg": executable file not found in %PATH%
- VSCode调试go语言出现:exec: "gcc": executable file not found in %PATH%
- 调试go语言出现:exec: "gcc": executable file not found in %PATH%
- go exec: "gcc": executable file not found in %PATH%
- Exception in thread "main" java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
- 启动hive报错:("com.mysql.jdbc.Driver") was not found in the CLASSPATH
- 项目忽然出现 The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path 解决方法
- MySql JDBC in eclipse "The driver class was not found in the specified driver JAR/Zip file." error
- 关于写入文件缓存时报"java.io.FileNotFoundException open failed (is a director)"错误的解决方法
- 解决"Bower : ENOGIT git is not installed or not in the PATH"问题
- Ubuntu技巧之"xxx is not in the sudoers file"解决方法
- WebDriverException: Cannot find firefox binary in PATH."的解决方法
- Ubuntu技巧之"xxx is not in the sudoers file"解决方法
- MyEclipse中启动tomcat报错:"bad version number in .class file"的解决方法
- File Not found 'DesignIntf.dcu'或者'Proxies.dcu' 的解决方法
- 导入SQL导致"MySQL server has gone away"的解决方法
- class not found exception:com.mysql.jdbc.Driver解决方法
- Exception in thread "main" java.sql.SQLException: ORA-00923: FROM keyword not found where expected