A ProxySQL Go library.
- Go 1.7 or higher.
- ProxySQL 1.3.x
Simple install the package to your $GOPATH with the go tool from shell:
# go get -u github.com/imSQL/proxysql
Make sure git command is installed on your OS.
example:
list all mysql_users .
conn, err := NewConn("172.18.10.111", 13306, "admin", "admin")
if err != nil {
t.Error(conn, err)
}
conn.SetCharacter("utf8")
conn.SetCollation("utf8_general_ci")
conn.MakeDBI()
db, err := conn.OpenConn()
if err != nil {
t.Error(db, err)
}
allusers, err := FindAllUserInfo(db, 1, 0)
if err != nil {
t.Error(allusers, err)
}
You can execute 'go test' command to test this project.
if proxysql is listening 172.18.10.136:13306, execute follow command:
# go test --args -addr 172.18.10.136 -port 13306 -user admin -pass admin
If you like the project and want to buy me a cola, you can through:
PayPal | 微信 |
---|---|