操作连接
已收录文章:1篇
-
安装 go get "github.com/go-sql-driver/mysql" go get "github.com/jmoiron/sqlx" 连接数据库 var Db *sqlx.DB db, err := sqlx.Open("mysql","username:password@tcp(ip:port)/database?charset=utf8") Db = db 连接2 package main import ( "database/sql" "410 收藏