去mysqlstack
go-mysqlstack是在Go(golang)中实现MySQL协议库。
协议基于和
运行测试
$ mkdir src
$ export GOPATH=`pwd`
$ go get -u github.com/xelabs/go-mysqlstack/driver
$ cd src/github.com/xelabs/go-mysqlstack/
$ make test
例子
examples / mysqld.go通过运行以下命令模拟MySQL服务器:
$ go run example/mysqld.go
2018/01/26 16:02:02.304376 mysqld.go:52: [INFO] mysqld.server.start.address[:4407]
examples / client.go模拟一个客户端并从模拟MySQL服务器查询:
$ go run example/client.go
2018/01/26 16:06:10.779340 client.go:32: [INFO] results:
1