Skip to content

dikang123/proxysql

Folders and files

NameName
Last commit message
Last commit date

Latest commit

eedae51 · Feb 26, 2018
Jan 16, 2018
Dec 21, 2017
Feb 6, 2018
Feb 6, 2018
Dec 22, 2017
Feb 6, 2018
Feb 26, 2018
Feb 11, 2018
Feb 12, 2018
Feb 12, 2018
Feb 6, 2018
Feb 6, 2018
Feb 9, 2018
Feb 11, 2018
Dec 26, 2017
Feb 11, 2018
Feb 26, 2018
Dec 21, 2017
Dec 26, 2017
Feb 12, 2018
Dec 26, 2017
Feb 6, 2018

Repository files navigation

Golang ProxySQL Library


1.introduce


A ProxySQL Go library.

2. Requirements


  1. Go 1.7 or higher.
  2. ProxySQL 1.3.x

3. Installation

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.

4. Usage


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)
}

5. Test


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

Donate


If you like the project and want to buy me a cola, you can through:

PayPal 微信

About

go proxysql library.

Resources

License

Stars

Watchers

Forks

Packages

No packages published