OSS TanbouSign in with GitHub

connect standard database/sql applications to MySQL and MariaDB with a pure-Go driver

About these scores

OSS scale score is an unbounded metric that log-compresses and weights Stars, Watchers, Forks, and Contributors. Discovery score is the current OSS scale score minus the score at discovery. Update pace is commits in the last 30 days, growth momentum is the OSS scale score difference within the recent observation window, and OSS health is a 0–100 rating based on available recency, Community Health, and release data.

Stars
15,278
Primary language
Go
License
MPL-2.0
Repository last updated
Oct 6, 2026
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.

Sources: [3][2][4]

Official sources

  1. [1]go-sql-driver/mysql — GitHub repository(2026-10-06)
  2. [2]Go MySQL Driver v1.10.1 — README(2026-10-06)
  3. [3]Go MySQL Driver v1.10.1 — go.mod(2026-10-06)
  4. [4]Go MySQL Driver v1.10.1 release(2026-10-06)
  5. [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. 1

    Get the source

    git clone --depth 1 https://github.com/go-sql-driver/mysql.git
  2. 2

    Enter the repository

    cd mysql
  3. 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
Check the official README

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

GitHub data

GitHub dataView detailed GitHub data

GitHub Topics

  • go
  • mysql
  • sql
  • database
  • mysql-driver
  • mariadb
Stars
15,278
Forks
2,337
Watchers
401
Open issues
44
Contributors
159
Owner type
Organization
Primary language
Go
License
MPL-2.0
Repository last updated
Oct 6, 2026
Write a related article

Share a guide or use case for this OSS in Markdown. Articles are published after administrator approval.

Report incorrect information

Tell us if any listing information is incorrect or outdated.

After reading this page, do you know what to do next?