Registry / database / driver-mysql

driver-mysql

JSON →
library1.6.0gogounverified

Package mysql provides a MySQL driver for the GORM ORM library.

go get gorm.io/driver/mysql
INSTALL
IMPORT
SIG · DRIVER-MYSQL
D
driver-mysql
databasegov1.6.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

mysql
gorm.io/driver/mysql

Open a GORM connection to a MySQL database.

package main import ( "gorm.io/driver/mysql" "gorm.io/gorm" ) func main() { dsn := "user:pass@tcp(127.0.0.1:3306)/dbname?charset=utf8mb4&parseTime=True&loc=Local" db, err := gorm.Open(mysql.Open(dsn), &gorm.Config{}) if err != nil { panic(err) } // Use db }
Debug
Known issues
gotchaDSN must include parseTime=True for time.Time support.
fix
Add 'parseTime=True' to the DSN.
affects: *
Upgrade
Version history
1.6.0latest on pkg.go.dev
Audit
Dependencies

No dependency data recorded yet.

Agent activity
26 hits · last 30 days
node
22
OpenAI (training)
1
Resources
driver-mysql — go get driver-mysql · libregistry