From: Jack Dempsey Date: 2001-12-14T14:13:03+09:00 Subject: [ruby-talk:28487] Re: mysql issues...looking for wrong socket i think i've got it... [root@Zeus mysql]# grep 'MYSQL_UNI' /usr/include/mysql/mysql_version.h #define MYSQL_UNIX_ADDR "/var/lib/mysql/mysql.sock" [root@Zeus mysql]# grep 'MYSQL_UNIX' /usr/local/mysql/include/mysql/mysql_version.h #define MYSQL_UNIX_ADDR "/tmp/mysql.sock" one version of mysql running...more than one source for include files... this might have been the problem --with-mysql-include= MySQL header directory. Default is /usr/local/include. --with-mysql-lib= MySQL library directory. Default is /usr/local/lib. --with-mysql-dir= Same as --with-mysql-include=/include, --with-mysql-lib=/lib. if as you say it should be > --with-mysql-include-dir=dir > MySQL header directory. Default is /usr/local/include > > --with-mysql-lib-dir=dir > MySQL library directory. Default is /usr/local/lib > > Pointed to the active version. gonna give this a shot and see what happens.... thanks! > > > In my /usr/include/mysql/mysql_version.h there is: > #define MYSQL_UNIX_ADDR "/var/lib/mysql/mysql.sock" > > Maybe doing a locate mysql_version.h would be enlightening. > > I'm not absolutely certain mysql-ruby uses these defines, I'd have to > look in the source code, but it seems a safe bet that since these switches > are there, that the headers are used, including finding where the socket is. > > Since it seems yours is not a multi-user system, it doesn't matter where the > socket is located, instead of recompiling MySQL I'd just try to get ruby to > find the socket properly. > > One last thought, I'm not sure if a link to a socket would work, I've never > tried it, but you might try doing a link from where it is in /tmp to where > Ruby is looking for it in /var/lib. It's a quick-and-dirty fix, if it works, > you're done, if it doesn't, you haven't wasted much time. > > On Fri, 14 Dec 2001 11:39:29 +0900 > "Jack Dempsey" wrote: > > > The daemon's definitely running....i of course tested out my normal command > > line connection and that was just fine...and if i ls /tmp i see "mysql.sock" > > I installed it and didn't change anything, so i don't know what could have > > happened... > > i agree its probably bad for security, but this is a dual boot machine > > that's not often up in linux...think i should recompile mysql and reinstall? > > i just don't think it'd change the tmp thing because i certainly didn't tell > > it to run the sockets in tmp..... > > > > jack > > > > -----Original Message----- > > From: Daniel P. Zepeda [mailto:daniel@zepeda-zone.net] > > Sent: Thursday, December 13, 2001 9:34 PM > > To: ruby-talk ML > > Subject: [ruby-talk:28477] Re: mysql issues...looking for wrong socket > > > > > > On any redhat system (and derivatives like mandrake) that I've ever worked > > on, MySQL creates the socket in /var/lib/mysql, just where Ruby is > > looking. Are you *sure* that you have the MySQL daemon running? Can you > > see the socket "file" in /tmp? If so, your administrator must have changed > > the default installation. From a security standpoint, making the socket in > > /tmp doesn't sound like a good idea. > > > > In any case, the socket file is defined in the MySQL include files, which > > the ruby module checks, so you shouldn't have to mess with this. > > > > I'll bet the daemon isn't running... > > > > > > On Fri, 14 Dec 2001 09:40:05 +0900 > > Jack Dempsey wrote: > > > > > hi all, > > > > > > i've got ruby 1.6.5 working well on redhat 7.2 and now i'd like to add > > > mysql support... > > > everything seems to work fine...it makes perfectly, but when i run > > > test.rb i get the following error > > > > > > [jack@Zeus mysql-ruby-2.4.1]$ ruby -I. ./test.rb localhost root password > > > > > > connect............../t/00connect.rb:1:in `connect': Can't connect to > > > local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) > > > (MysqlError) > > > from ./t/00connect.rb:1 > > > from ./test.rb:23:in `load' > > > from ./test.rb:23 > > > from ./test.rb:19:in `each' > > > from ./test.rb:19 > > > > > > mysql normally creates its sockets in /tmp so i can see how looking in > > > /var/lib... would be a problem...is there some way i can tell ruby to > > > look elsewhere, or perhaps recompile with a different option? > > > any help would be much appreciated.... > > > thanks! > > > jack dempsey > > > > > > > > > -- > > Daniel P. Zepeda > > daniel@zepeda-zone.net > > > > -- > Daniel P. Zepeda > daniel@zepeda-zone.net