Ruby, Rails & MySQL - configuration problem

Discussion in 'Ruby' started by Kenosis, Jul 15, 2005.

  1. Kenosis

    Kenosis Guest

    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
    Kenosis, Jul 15, 2005
    #1
    1. Advertising

  2. Kenosis

    Kenosis Guest

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

    Ken
    Kenosis, Jul 15, 2005
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Randy Lawrence

    mysql-ruby or ruby-mysql?

    Randy Lawrence, May 23, 2004, in forum: Ruby
    Replies:
    3
    Views:
    102
    Randy Lawrence
    May 24, 2004
  2. Replies:
    6
    Views:
    176
    Michael Campbell
    Mar 17, 2005
  3. Josef 'Jupp' SCHUGT
    Replies:
    5
    Views:
    161
    Stephan Kämper
    Jan 24, 2006
  4. Jason Wong
    Replies:
    0
    Views:
    160
    Jason Wong
    Nov 20, 2007
  5. Xeno Campanoli
    Replies:
    4
    Views:
    88
    Xeno Campanoli
    Mar 1, 2008
Loading...

Share This Page