Using go with mysql

166 views
Skip to first unread message

payel...@gmail.com

unread,
Jun 5, 2015, 4:15:30 AM6/5/15
to golan...@googlegroups.com
Hi,
I have trying to use mysql with go. I have done the following:


Then I  am trying to run the example in https://github.com/go-sql-driver/mysql/wiki/Examples but I get the following error:

dial tcp 127.0.0.1:3306: connection refused

exit status 1


Can anybody tell me why the connection gets refused? Do I need to install mysql separately?

Tamás Gulácsi

unread,
Jun 5, 2015, 4:34:47 AM6/5/15
to golan...@googlegroups.com
Yes, you need a mysql db to connect to. The driver is just the client, not the server.

Richard Hibbitts

unread,
Jun 5, 2015, 2:41:25 PM6/5/15
to golan...@googlegroups.com, payel...@gmail.com
Yes, you still need a separate MySQL server running and listening to port 3306 (MySQL default) on your localhost.
Reply all
Reply to author
Forward
0 new messages