You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Support MySQL official URI connection format (mysql://...) #1736
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.
Reacted by Étienne BERSAC, elonnzhang and Prabhat Kumar Rai
Of course, you can work on this. But whether to adopt it is another matter.
This is a breaking change for a lot of existing code. The first task will be to come up with a plan for everyone to migrate.
After reviewing that plan, we will carefully and thoughtfully consider the pros and cons over time and decide whether to make the change.
@methane Got it, thanks for the clarification! I’ll start looking into this and draft some initial ideas, but I’ll definitely need your input along the way. It would be really helpful if you could also add your thoughts or suggestions.
One important thing to note here: this is not actually a "MySQL official URI connection format", nor is it a "standard". It's just an optional way to specify connection information for MySQL Shell (mysqlsh). As far as I know, no other "official" MySQL client programs from Oracle use this format so far, and nothing in MariaDB uses this format either.
Also in terms of the params, the ones supported by MySQL Shell inherently differ from what is supported by the Go driver. This may cause some confusion if implemented. Ditto for the way unix socket connections are specified in this scheme.
Edit to add: I'm partially mistaken above, I suppose one could correctly consider that URI format "official" based on its support in all the Oracle-supplied Connector drivers. However personally I still think this isn't widespread enough to justify well:
One motivator for Oracle creating this URI scheme was to support multiple protocols (classic mysql:// vs newer X protocol mysqlx://). But go-sql-driver/mysql does not support X protocol (see Add XAPI support #478). Most third-party drivers (for any language) do not support it either. In any case, this motivation is not relevant here at this time.
Third-party drivers tend not to support this exact format, if they even support URIs at all.
Aside from mysqlsh, other official MySQL tools do not support URIs. For example mysql, mysqldump, mysqladmin all do not.
Activity
ayushdoesdev commentedon Oct 31, 2025
Can I work on this?
ayushdoesdev commentedon Oct 31, 2025
@methane @julienschmidt @arnehormann , If this needs to be done then can I work on this?
methane commentedon Oct 31, 2025
Of course, you can work on this. But whether to adopt it is another matter.
This is a breaking change for a lot of existing code. The first task will be to come up with a plan for everyone to migrate.
After reviewing that plan, we will carefully and thoughtfully consider the pros and cons over time and decide whether to make the change.
ayushdoesdev commentedon Oct 31, 2025
@methane Got it, thanks for the clarification! I’ll start looking into this and draft some initial ideas, but I’ll definitely need your input along the way. It would be really helpful if you could also add your thoughts or suggestions.
evanelias commentedon Nov 25, 2025
One important thing to note here: this is not actually a "MySQL official URI connection format", nor is it a "standard". It's just an optional way to specify connection information for MySQL Shell (
mysqlsh). As far as I know, no other "official" MySQL client programs from Oracle use this format so far, and nothing in MariaDB uses this format either.Also in terms of the params, the ones supported by MySQL Shell inherently differ from what is supported by the Go driver. This may cause some confusion if implemented. Ditto for the way unix socket connections are specified in this scheme.
Edit to add: I'm partially mistaken above, I suppose one could correctly consider that URI format "official" based on its support in all the Oracle-supplied Connector drivers. However personally I still think this isn't widespread enough to justify well:
mysql://vs newer X protocolmysqlx://). Butgo-sql-driver/mysqldoes not support X protocol (see Add XAPI support #478). Most third-party drivers (for any language) do not support it either. In any case, this motivation is not relevant here at this time.mysqlsh, other official MySQL tools do not support URIs. For examplemysql,mysqldump,mysqladminall do not.saitocg commentedon Feb 4, 2026
The URL scheme provided by
Pulsarcan be used as a reference for us.Here there will be default behavior (using TCP)
or specify the specific the transport protocol