package main
import (
"database/sql"
"log"
"testing"
_ "github.com/go-sql-driver/mysql"
)
func TestQuery(t *testing.T) {
// 1.创建连接
db, err := sql.Open("mysql", "root:123456@tcp(127.0.0.1:9031)/game?charset=utf8mb4&parseTime=True&interpolateParams=true")
defer db.Close()
if err != nil {
log.Fatal(err)
}
_, err = db.Prepare("SELECT * FROM log_logon limit ?")
if err != nil {
log.Fatal(err)
}
}
报错:Error 1295 (HY000): Not supported such prepared statement