From: Mat Schaffer Date: 2007-01-25T00:14:00+09:00 Subject: Re: mysql-ruby won't connect On Jan 2, 2007, at 2:50 AM, ziggurism@gmail.com wrote: > I'm trying to get my first ruby box set up. I'm so far unable to > connect to the mysql database with mysql-ruby. > > I'm on an Intel Mac, running macosx tiger 10.4.8. At first, I > couldn't > even compile the plugin, there is some bug in the software. It > gave an > error like ... > I suspect that the mysql-ruby plugin is not sending the correct > host/user/password as specified, but I'm really not sure, nor can I > figure out a way to debug this further. Any help you can offer me > would be greatly appreciated. Sorry this took me forever to get back to, but I think I may have stumbled across a fix. Basically the problem seems to surround mysql's replacement of a ulong typedef with my_ulonglong instead. No idea why. Pretty sure it's something new with MySQL 5, maybe even just only the OS X distribution. Anyway, before you compile the gem insert the following at line 108 in mysql.h (probably /usr/local/mysql/include/mysql.h) #if !defined(HAVE_ULONG) && !defined(TARGET_OS_LINUX) && !defined (__USE_MISC) typedef unsigned long ulong; /* Short for unsigned long */ #endif Then build the gem: sudo gem install mysql -- --with-mysql-dir=/usr/local/mysql # not sure if that mysql-dir field is necesary, but I did it anyway Now password authentication is working for me again. I'd also remove those lines from mysql.h once you're done. I have no idea what they'd do when trying to compile other plugins. I haven't researched what the exact cause of the problem, but this seems like a workaround till mysql and the mysql gem get back in sync. Hope it helps! -Mat