getting started with GoMySQL, HELP !!

152 views
Skip to first unread message

Riadh Mankaï

unread,
Dec 28, 2011, 3:39:21 AM12/28/11
to GoMySQL
Hi every one,
I'm a student in an engineering school, in Marseilles, France. We are
currently working on a project in Go language : a basic CMS. But I
really have a problem to connect to a database from a go program. I've
tried many tools (GoSqlite, gopgsqldriver, mongodb), with no success.
I also didn't succeed to connect to a data base using GoMysql, but at
least, with this one, I'm sure it is well installed.

I've copied the code in the first example(simple query) in this page :
https://github.com/Philio/GoMySQL
I'm using Xampp on Ubuntu, so I've created a database with PhpMyAdmin
client.

It would be nice if you can help me. Thanks in advance !
Riadh

Phil Bayfield

unread,
Dec 28, 2011, 7:26:20 AM12/28/11
to gom...@googlegroups.com

Hi Riadh

Did you get some kind of error when you tried the library?

Riadh

--
You received this message because you are subscribed to the Google Groups "GoMySQL" group.
To post to this group, send email to gom...@googlegroups.com.
To unsubscribe from this group, send email to gomysql+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gomysql?hl=en.


Riadh Mankai

unread,
Dec 28, 2011, 8:45:38 AM12/28/11
to gom...@googlegroups.com
No, no errors ! It never connects to the database. For example, in the usage example in gihub, it quits the program : if err != nil {  
    os.Exit(1) 
This means that the first line gives an error : db, err := mysql.DialUnix(mysql.DEFAULT_SOCKET, "user", "password", "database") 

As I said before, I created the datebase using Xampp in Ubuntu, with the PHPMyAdmin tool. Maybe It was a wrong way to create the database.

2011/12/28 Phil Bayfield <ma...@phil.io>

Phil Bayfield

unread,
Dec 29, 2011, 5:31:26 AM12/29/11
to gom...@googlegroups.com
It could be a compatibility problem with the latest version of Go, the library hasn't had many updates lately as I've been busy with a big project at work for the last 9 months and not any time to put into my own projects.
Reply all
Reply to author
Forward
0 new messages