On this page
Overview
Go MySQL Driver implements Go's standard database/sql/driver interface. It is written in pure Go and supports TCP, Unix sockets, database/sql connection pooling and contexts, prepared statements, TLS, LOAD DATA LOCAL INFILE, and optional time.Time conversion.
Features and best fit
Based on official documentation; not hands-on tested · Content checked:
Key features
Use MySQL connections, queries, and transactions through standard database/sql
Import the driver and open it with sql.Open("mysql", dsn) while keeping standard database/sql queries, transactions, contexts, and connection pooling.
Sources: [2]
Configure networking, timeouts, TLS, and time parsing through the DSN
The DSN controls protocol and address, connection/read/write timeouts, TLS, parseTime, charset options, and related driver behavior.
Sources: [2]
Best fit
Fits Go backends that want MySQL or MariaDB without leaving the database/sql ecosystem
It can sit under ORMs or helpers such as sqlx and is a natural choice when applications want to avoid binding their whole data layer to driver-specific APIs.
Sources: [2]
Before adoption
v1.10.1 requires Go 1.24+; verify pool lifetime and DSN behavior on upgrades
Version 1.10.1 requires Go 1.24 or newer and maintainers support MySQL 5.7+ and MariaDB 10.5+. The README recommends explicit connection lifetime, max-open, and max-idle settings. The release also changes the default network in NewConfig to tcp and interpolates typed-nil json.RawMessage as NULL, so DSN construction and parameter handling need regression coverage.
Official sources
- [1]go-sql-driver/mysql — GitHub repository(2026-10-06)
- [2]Go MySQL Driver v1.10.1 — README(2026-10-06)
- [3]Go MySQL Driver v1.10.1 — go.mod(2026-10-06)
- [4]Go MySQL Driver v1.10.1 release(2026-10-06)
- [5]Go MySQL Driver MPL-2.0 license(2026-10-06)
Supplemental curator note
This driver keeps applications on the standard database/sql API. Production reliability depends on configuring connection lifetime, open and idle pool sizes, TLS, and timeouts for the deployment environment.
Try it in 3 steps
- 1
Get the source
git clone --depth 1 https://github.com/go-sql-driver/mysql.git - 2
Enter the repository
cd mysql - 3
Check the official steps
Continue with the commands in the README Installation, Quick Start, or Getting Started section.
find . -maxdepth 1 -iname 'README*' -exec sed -n '1,220p' {} \; -quit
Growth
Growth trends · Last 30 days
15,278 Stars
Trend data is still being collected.
Development activity
Last 90 days · weekly
- Commits (last 30 days)
- 6
- Open PRs
- 15
Development activity is still being collected.
Built with
Categories and tags
Categories
GitHub data
GitHub dataView detailed GitHub data
GitHub Topics
- go
- mysql
- sql
- database
- mysql-driver
- mariadb
Related information
Write a related articleShare a guide or use case for this OSS in Markdown. Articles are published after administrator approval.
Explore next
- mysql22,273 Stars
4 shared tag(s) · 2 shared category(s)
connect Ruby to MySQL or MariaDB and handle SQL queries, prepared statements, and streaming results
Ruby - MySQL Server12,441 Stars
4 shared tag(s) · 1 shared category(s)
Run relational workloads with InnoDB transactions, SQL, replication, and high-availability tooling
C++ - MariaDB Server8,320 Stars
4 shared tag(s) · 1 shared category(s)
Provide MySQL-compatible protocols, pluggable storage engines, replication, and native vector search in one SQL database
C++ - Kysely14,262 Stars
3 shared tag(s) · 2 shared category(s)
keep SQL structure visible while using TypeScript inference for safe queries and result types
TypeScript - node-postgres13,219 Stars
3 shared tag(s) · 2 shared category(s)
connect Node.js directly to PostgreSQL with pools, parameterized queries, and LISTEN/NOTIFY
JavaScript - SQLAlchemy12,201 Stars
3 shared tag(s) · 2 shared category(s)
combine SQL expressions and ORM mapping in one Python data-access toolkit
Python
Report incorrect information
Tell us if any listing information is incorrect or outdated.