go-sql-driver / go-sql-driver/mysql
Support MySQL official URI connection format (mysql://...)
- Dominant language
- Go
- Stars
- 15.3k
- Forks
- 2.3k
- Avg merge
- 2h 23m
- Merged PRs (30d)
- 10
Description
Currently, the Go MySQL driver only supports the following DSN format:
```
user:password@tcp(localhost:3306)/dbname?param1=value1.
```
However, MySQL’s [official documentation](https://dev.mysql.com/doc/refman/8.4/en/connecting-using-uri-or-key-value-pairs.html#connecting-using-uri)
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.
Contributor guide
Assessment
This issue has not been assessed yet.