go-sql-driver / go-sql-driver/mysql

set default protocol to tcp

Open
#1,074 3 comments 5 reactions 0 assignees View on GitHub
thinking
Dominant language
Go
Stars
15.3k
Forks
2.3k
Avg merge
2h 23m
Merged PRs (30d)
10

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
```go
“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():
```go
"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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.