go get gorm.io/gorm
go get gorm.io/driver/mysql
go get gorm.io/driver/sqlite
package main
import (
"database/sql"
"fmt"
"log"
"github.com/gin-gonic/gin"
_ "github.com/go-sql-driver/mysql"
)
mysqlStr := "root:root@tcp(127.0.0.1:3306)/gohub"
db, _ := sql.Open("mysql", mysqlStr)
rows, err := db.Query("select * from users")