Open
Description
Issue description
Can tcp of the connection string be set as a default protocol option, which will fix the url standard, we can easily parse out the parameters of the entire connection string, and adding the tcp parameter will cause the entire string to fail to complete according to the url standard Parsing.
Example code
“mysql://root:123456@127.0.0.1:3339/ad_base?charset=utf8”
this url can be parsed.but this url can not be parsed because of tcp():
"mysql://root:123456@tcp(127.0.0.1:3339)/ad_base?charset=utf8"
Configuration
*Driver version (or git SHA):latest
*Go version:go 1.12-1.14
*Server version: MySQL 8.0
Server OS: E.g. Mac OS Catalina
Metadata
Metadata
Assignees
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
dolmen commentedon Jun 1, 2020
Use
mysql.ParseDSN
to parse a DSN.methane commentedon May 26, 2023
DSN is not URL. But I think
address/db
is better thannetwork/db
.But it is breaking change. Currently,
unix/db
is valid DSN. It means to connecut localhost db with unix socket where the default location.After changing it,
unix/db
meanstcp(unix:3306)/db
. So this is breaking change.I like the change. I am worried about what everyone will think of the breaking changes.
binarious commentedon Oct 23, 2024
ParseDSN
also fails to parse the provided DSN withouttcp()
. The main issue is that the current DSN format required for TCP connections can't be shared with other tools (likeatlas
), which typically default to TCP but don't accept thetcp()
syntax. Additionally, using?protocol=tcp
isn't an option, leading to the need to define the DSN at least twice.ARCHIVISTA_SQL_STORE_*
in-toto/archivista#127