Lightweight and fast, native Go implementation. No C-bindings, just pure Go. Connections over TCP/IPv4, TCP/IPv6, Unix domain sockets or custom protocols. Automatic handling of broken connections, as well as automatic Connection Pooling (by database/sql package). Supports queries larger than 16MB. Full sql.RawBytes support. It provides intelligent LONG DATA handling in prepared statements. Secure LOAD DATA LOCAL INFILE support with file allowlisting and io.Reader support. Optional time.Time parsing, as well as optional placeholder interpolation. db.SetConnMaxLifetime() is required to ensure connections are closed by the driver safely before connection is closed by MySQL server, OS, or other middlewares. Since some middlewares close idle connections by 5 minutes, we recommend timeout shorter than 5 minutes. This setting helps load balancing and changing system variables too.

Features

  • The connection pool is managed by Go's database/sql package
  • Go 1.8 added database/sql support for context.Context, this driver supports query timeouts and cancellation via contexts
  • Since version 1.5 Go-MySQL-Driver automatically uses the collation utf8mb4_general_ci by default
  • Native Go implementation, no C-bindings, just pure Go
  • To run the driver tests you may need to adjust the configuration
  • Package mysql provides a MySQL driver for Go's database/sql package

Project Samples

Project Activity

See All Activity >

License

Mozilla Public License 2.0 (MPL 2.0)

Follow Go MySQL Driver

Go MySQL Driver Web Site

Other Useful Business Software
Skillfully - The future of skills based hiring Icon
Skillfully - The future of skills based hiring

Realistic Workplace Simulations that Show Applicant Skills in Action

Skillfully transforms hiring through AI-powered skill simulations that show you how candidates actually perform before you hire them. Our platform helps companies cut through AI-generated resumes and rehearsed interviews by validating real capabilities in action. Through dynamic job specific simulations and skill-based assessments, companies like Bloomberg and McKinsey have cut screening time by 50% while dramatically improving hire quality.
Learn More
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of Go MySQL Driver!

Additional Project Details

Programming Language

Go

Related Categories

Go Database Software, Go Load Balancers

Registered

2021-05-27