Skip to content

Commit fb9430c

Browse files
committed
Merge pull request astaxie#139 from JulienSchmidt/patch-1
Go-MySQL-Driver is now at GitHub
2 parents 55605ae + 37e36a2 commit fb9430c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

5.2.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
## MySQL驱动
55
Go中支持MySQL的驱动目前比较多,有如下几种,有些是支持database/sql标准,而有些是采用了自己的实现接口,常用的有如下几种:
66

7-
- http://code.google.com/p/go-mysql-driver/ 支持database/sql,全部采用go写。
7+
- https://github.com/Go-SQL-Driver/MySQL 支持database/sql,全部采用go写。
88
- https://github.com/ziutek/mymysql 支持database/sql,也支持自定义的接口,全部采用go写。
99
- https://github.com/Philio/GoMySQL 不支持database/sql,自定义接口,全部采用go写。
1010

@@ -37,7 +37,7 @@ Go中支持MySQL的驱动目前比较多,有如下几种,有些是支持data
3737
package main
3838

3939
import (
40-
_ "code.google.com/p/go-mysql-driver/mysql"
40+
_ "github.com/Go-SQL-Driver/MySQL"
4141
"database/sql"
4242
"fmt"
4343
//"time"
@@ -114,10 +114,10 @@ Go中支持MySQL的驱动目前比较多,有如下几种,有些是支持data
114114

115115
关键的几个函数我解释一下:
116116

117-
sql.Open()函数用来打开一个注册过的数据库驱动,go-mysql-driver中注册了mysql这个数据库驱动,第二个参数是DNS(Data Source Name),它是go-mysql-drivev定义的一些数据库链接和配置信息。它支持如下格式:
117+
sql.Open()函数用来打开一个注册过的数据库驱动,Go-MySQL-Driver中注册了mysql这个数据库驱动,第二个参数是DNS(Data Source Name),它是Go-MySQL-Driver定义的一些数据库链接和配置信息。它支持如下格式:
118118

119119
user@unix(/path/to/socket)/dbname?charset=utf8
120-
user:password@tcp(localhost:5555)/dbname?charset=utf8&keepalive=1
120+
user:password@tcp(localhost:5555)/dbname?charset=utf8
121121
user:password@/dbname
122122
user:password@tcp([de:ad:be:ef::ca:fe]:80)/dbname
123123

0 commit comments

Comments
 (0)