Home  >  Article  >  Database  >  GoLang 连接 Mysql 数据库

GoLang 连接 Mysql 数据库

WBOY
WBOYOriginal
2016-06-07 15:18:101135browse

搜索下 找到一个 golang 的库地址: ? http://go-lang.cat-v.org/library-bindings ? 有数据库。。gui 等。 ? 发现就这个更新 时间最近。。下载 zip包。 ? https://github.com/Philio/GoMySQL ? 经过编译发现只可以再 linux 下面进行编译。windows 没有弄好

搜索下 找到一个 golang 的库地址:

?

http://go-lang.cat-v.org/library-bindings

?

有数据库。。gui 等。

?

发现就这个更新 时间最近。。下载 zip包。

?

https://github.com/Philio/GoMySQL

?

经过编译发现只可以再 linux 下面进行编译。windows 没有弄好。

?

首先在 linux 下面设置环境变量:

?

?

export PATH=$PATH:/opt/google/go/bin
export GOROOT=/opt/google/go

?然后 解压缩

?

?

Clone the git repository:

git clone git://github.com/Philio/GoMySQL.git

Build / install:

cd GoMySQL
make
make install

This installs the package as 'mysql' so can be imported as so:

import "mysql"

?

?


GoLang 连接 Mysql 数据库

?

如果编译没有报错误。就说明已经编译通过了。可以使用mysql 的包了。

?

?

使用 mysql 数据库连接 还要研究下。

?

go 语言视频。

?

中文:

?

http://v.youku.com/v_show/id_XMTY4Mzk5NTc2.html

?

英文:

?

http://v.youku.com/v_show/id_XMTMxMzIwMTQ4.html

?

?

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:在RHAS4下安装oracle 10GNext article:mysql函数