I am trying to connect to a mysql database I have locally, using golang, it builds just fine but running it gives me the following error:
panic: sql: expected 0 arguments, got 1
My connection looks like this:
package main
import (
"database/sql"
"fmt"
_ "github.com/go-sql-driver/mysql"
)
func DBConn() {
team := "software"
db, err := sql.Open("mysql", "root:12345678@tcp(localhost:3306)/flexlocal")
if err != nil {
fmt.Println("this is where it all went wrong")
fmt.Printf(err.Error())
panic(err)
}
}
According to my research this is how it works however it just isn't working for me.