Sql: unknown driver "mysql" (forgotten import?)

Hey @RafaelGopher,

Try installing the go-sql-driver/mysql driver with go get github.com/go-sql-driver/mysql and then using _ "github.com/go-sql-driver/mysql" as an import and see if that works instead.

You can check it out here if you like: https://github.com/go-sql-driver/mysql.

You would also open it with this db, err := sql.Open("mysql", "user:password@/dbname"), but here are their examples if you want to try it: https://github.com/go-sql-driver/mysql/wiki/Examples.

1 Like