Ruby, Rails & MySQL - configuration problem

K

Kenosis

Greetings,

Perhaps this should be posted to a mysql related group, however I'm
guessing someone in the Ruby/Rails community may have seen this problem
so I'm posting here hoping for some help.

So, I have Ruby 1.8.x, Rails and MySQL installed and running on a
RedHat Linux PC. Ruby compiles and runs fine as does Rails. The
problem I'm having is w/MySQL configuration: in order to get the MySQL
binary distribution I installed on my PC to run its self-tests and
bench marks, I had to setup /etc/my.cfg as follows:

[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock


[mysql.server]
user=mysql
basedir=/var/lib


[safe_mysqld]
err-log=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid


[client]
socket=/tmp/mysql.sock
password=<omitted :>

When I try to connect to my test database (per the Rails tutorial at
http://www.onlamp.com/pub/a/onlamp/2005/01/20/rails.html), MySQL fails
to find the client socket /tmp/mysql.sock.

I had this same problem with MySQL's mysql-tests: adding the [client]
section (as above) to my.cfg fixed this problem. Similarly, the MySQL
sql-bench would not run w/out the [mysqld] socket set to
/var/lib/mysql/mysql.sock Admittedly, I'm new to MySQL and Linux so
there must be something obvious I'm missing.

Lastly, as I progress through the aforementioned Rails tutorial, all
works fine up to the point of trying to read from MySQL so I presume my
configuration of database.yml is correct (the connection is not being
deined.)

Any help you can lend will, as always, be appreciated.

Ken Hilton
Kenosis LLC
 
K

Kenosis

Of course, 5 minutes after I posted this I figured it out :) Thanks
never-the-less :)

Ken
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,810
Latest member
Kassie0918

Latest Threads

Top