danny
(Daniel Osineye)
1
Hi,
I do not understand the parameters in the sql.Open() function. Particularly the second one that looks like this… user:password(ip)/table
Please help with an explanation on how to relate this to my own localhost. The documentation is not clear on the parameters.
Cheers
Daniel
j1436go
(Jens Groß Ophoff)
2
That’s a Data source name. You can read a bit more about it on wikipedia:
elithrar
(Matt Silverlock)
3
Which database driver are you using?
danny
(Daniel Osineye)
5
Yeah, thanks. j1436go
The syntax is a major issue.
elithrar
(Matt Silverlock)
6
// Could also be "user:@/dbname" if no password and on localhost.
db, err := sql.Open("mysql", "user:password@localhost/dbname")
1 Like
system
(system)
Closed
7
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.