Skip to content

Commit 7f692db

Browse files
committed
Prepare for DSN without dbname
1 parent 22c4fd4 commit 7f692db

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

README.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,16 @@ A DSN in its fullest form:
6464
username:password@protocol(address)/dbname?param=value
6565
```
6666

67-
Except the databasename all values are optional, so the shortest possible DSN is:
67+
Except the databasename all values are optional, so the minimal DSN is:
6868
```
6969
/dbname
7070
```
7171

72+
If you don't want to preselect a database, leave `dbname` empty:
73+
```
74+
/
75+
```
76+
7277
### Password
7378
Passwords may consist of any char. No escaping necessary.
7479

@@ -110,6 +115,11 @@ user:password@tcp(localhost:5555)/dbname?charset=utf8
110115
user:password@/dbname
111116
```
112117

118+
No Database preselected:
119+
```
120+
user:password@/
121+
```
122+
113123
```
114124
user:password@tcp([de:ad:be:ef::ca:fe]:80)/dbname
115125
```

packets.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import (
1818
)
1919

2020
// Packets documentation:
21-
// http://forge.mysql.com/wiki/MySQL_Internals_ClientServer_Protocol
21+
// http://dev.mysql.com/doc/internals/en/client-server-protocol.html
2222

2323
// Read packet to buffer 'data'
2424
func (mc *mysqlConn) readPacket() ([]byte, error) {

0 commit comments

Comments
 (0)