#1736·mysql

Support MySQL official URI connection format (mysql://...)

Author: NamanMahorCreated Sep 12, 2025Updated Feb 4, 2026

Currently, the Go MySQL driver only supports the following DSN format:

user:password@tcp(localhost:3306)/dbname?param1=value1.

However, MySQL’s official documentation

defines a URI-based connection string format that looks like this:

mysql://user:password@localhost:3306/dbname?param1=value1

It would be useful if the driver could support the official URI scheme in addition to the current DSN format, for consistency with MySQL clients and other language drivers.

This would allow Go applications to accept and use standard MySQL connection URIs (e.g. from environment variables or config files) without having to reformat them.