A pure Go MySQL driver implementing Go's database/sql interface for connecting Go applications to MySQL and MariaDB databases.
Go-MySQL-Driver is a database driver written in pure Go that implements the database/sql/driver interface, allowing Go applications to connect to and interact with MySQL, MariaDB, and compatible databases like TiDB. It solves the need for a reliable, high-performance, and idiomatic way to perform database operations in Go without relying on C bindings or external dependencies.
Go developers building applications that require database connectivity to MySQL or MariaDB, particularly those who value native Go implementations, need connection pooling, or require support for modern database features like context cancellation and secure data handling.
Developers choose Go-MySQL-Driver because it's a lightweight, fast, and fully featured driver maintained by the Go community, offering automatic connection handling, support for large queries, and compliance with Go's standard database/sql package without the overhead of C bindings.
Go MySQL Driver is a MySQL driver for Go's (golang) database/sql package
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Written entirely in Go without C bindings, ensuring easy compilation and portability across platforms, as highlighted in the 'Native Go Implementation' feature.
Integrates with Go's database/sql package to manage connection pooling and recover from broken connections automatically, reducing manual overhead.
Supports modern database features like context cancellation for timeouts, queries larger than 16MB, and secure LOAD DATA LOCAL INFILE with file allowlisting.
Connects via TCP/IPv4, TCP/IPv6, Unix domain sockets, or custom protocols, offering adaptability for various network environments.
While compatible with databases like TiDB and Percona, the README states maintainers do not investigate or resolve issues for them, pushing responsibility to users.
The DSN has many parameters (e.g., ConnMaxLifetime settings), and misconfiguration can lead to performance issues or security risks, requiring expert tuning.
Does not support ColumnType.Length() from Go's database/sql interface, limiting some advanced type introspection capabilities.