SitePoint Sponsor

User Tag List

Results 1 to 13 of 13
  1. #1
    SitePoint Zealot
    Join Date
    Aug 2004
    Location
    Michigan
    Posts
    156
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Installing mySQL 5.0.27 on OS X 10.4.8

    I'm on page number 29 in "Build Your Own Ruby on Rails Web Application" where Patrick is instructing us on how to install mySQL. I've downloaded the current stable release of mySQL, run the mysql-standard-5.0.27-osx10.4-powerpc.pkg and was told that the installation was successful. Here is my concern:

    I remember many months ago when I was fooling around with PHP and I recall installing multiple versions of PHP and mySQL on my machine. I remember specifically using Marc Liyanage's packages available on www.entropy.ch as well as MAMP.

    Now, when I execute the following commands as per Patrick's instructions, I receive errors.

    From the book:
    Excellent. Next, we need to start the server—we’ll do this manually for now.
    Open a Terminal window and enter the following command:
    Code:
    $ sudo /usr/local/bin/mysqld_safe5
    This is returned:
    Code:
    Password:
    sudo: /usr/local/bin/mysqld_safe5: command not found
    mason:~ Mason$
    Included in my mysql-standard-5.0.27-osx10.4-powerpc.dmg file is a ReadMe.txt, which provides a different command for connecting to the mySQL server. That is:

    Code:
    $ sudo /Library/StartupItems/MySQLCOM/MySQLCOM start
    Which after entering that, I receive:
    Code:
    Starting MySQL database server
    And yay, the server appears to have been started!

    This is where things start getting confusing for me

    Now Patrick says:
    Once MySQL is running, you can tell it to run in the background by hitting Ctrl-
    Z, then entering this command:
    Code:
    $ bg
    When I press Control-Z and enter 'bg', the message returned to me is:
    Code:
    -bash: bg: current: no such job
    Hmm. Does that mean mySQL really isn't running? Also, what does pressing Control-Z do? Anything special? How do I know that whatever it's supposed to do is actually being done? Should something indicate that it's been pressed?

    Not knowing what to do, I proceed with his further instructions to:

    ...close the Terminal window; MySQL will continue to run as a server
    on your system. Now, all that’s left to do is confirm that the MySQL server is
    indeed running as expected. In your Terminal window, type the following:
    Code:
    $ ps -ax | grep mysql
    This command should return a few processes that relate to MySQL.
    Running that command returns this:
    Code:
     4903  p1- S      0:00.04 /bin/sh ./bin/mysqld_safe --datadir=/usr/local/mysql/
     4922  p1- S      0:05.15 /usr/local/mysql/bin/mysqld --basedir=/usr/local/mysq
     7260  p1  R+     0:00.00 grep mysql
    Since I'm new to all of this, I can't tell if that's good or bad or if that means mySQL is actually running or it isn't. It does at least appear to show the processes that are running, like he said. Does anyone know if mySQL is actually running though?

    He goes on to say:
    If it does, you can try to connect to your database with the following
    command:
    Code:
    $ mysql5
    This should present you with a mysql> prompt
    I figure, since it does return some processes, like he said it would, it's ok to try that command out. But, oh noes! This is what happens when I do:

    Code:
    -bash: mysql5: command not found
    So, just out of curiosity, I decide to look in /usr/local/bin/ where apparently this thing belongs, but it isn't there!

    So now I'm at an impasse. I have to wonder, could my previous installations of mySQL be conflicting somehow with my recent one? Why isn't mysql5 in /usr/local/bin/ and why am I not being presented with a mysql prompt when I enter mysql5 into the command line?

    I'm not sure if I should proceed in the book without first working this out as I question whether or not leaving it unresolved could create more problems and confusion for me down the line.

  2. #2
    SitePoint Zealot
    Join Date
    Aug 2004
    Location
    Michigan
    Posts
    156
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    UPDATE

    I took another gander at the ReadMe.txt file included in my dmg file and the instructions say:
    You should be able to connect to the MySQL server, for example, by
    running `/usr/local/mysql/bin/mysql'.
    So, I run that command, and sure enough, it says:
    Code:
    Welcome to the MySQL monitor.  Commands end with ; or \g.
    Your MySQL connection id is 1 to server version: 5.0.27-standard
    
    Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
    
    mysql>
    Does this mean I'm ok? Do I need to change anything?

    Is it possible the instructions Patrick is giving are just slightly dated, and perhaps a thing or two has changed some the time of writing?

    This offers me a little relief.

  3. #3
    SitePoint Guru
    Join Date
    Aug 2005
    Posts
    986
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That means you're ok (if you can execute queries that is...).

    I always use mysqld& to start MySQL, is this dated (anyway, it works )?

  4. #4
    SitePoint Zealot
    Join Date
    Aug 2004
    Location
    Michigan
    Posts
    156
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Fenrir2 View Post
    That means you're ok (if you can execute queries that is...).

    I always use mysqld& to start MySQL, is this dated (anyway, it works )?
    Code:
    mason:~ Mason$ mysqld&
    [1] 3923
    mason:~ Mason$ -bash: mysqld: command not found
    :/

  5. #5
    SitePoint Guru
    Join Date
    Aug 2005
    Posts
    986
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Type "whereis mysqld" and add the path you get to your PATH. If you don't see a path then you don't have mysqld...but MySQLCON seems to work so it's no problem.

  6. #6
    SitePoint Zealot
    Join Date
    Aug 2004
    Location
    Michigan
    Posts
    156
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hello Fenrir2,

    When I enter whereis mysqld, nothing is returned. It simply puts me on a new line, like so:

    Code:
    Welcome to Darwin!
    mason:~ Mason$ whereis mysqld
    mason:~ Mason$
    What is mysqld, and how do I get it working properly?

    Thanks!

  7. #7
    reads the ********* Crier silver trophybronze trophy longneck's Avatar
    Join Date
    Feb 2004
    Location
    Tampa, FL (US)
    Posts
    9,854
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    mysqld& is a dangerous and outdated way to start the server process. you should instead use mysqld_safe as the manual states.

    stoavio- you're all set. don't do anything else. your server is already up and running and you appear to be able to connect with the client to execute queries.

  8. #8
    SitePoint Zealot
    Join Date
    Aug 2004
    Location
    Michigan
    Posts
    156
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    @longneck: Thanks! So, is there anything I need to do to get the mySQL server started? mysql-standard-5.0.27-osx10.4-powerpc.dmg did come with MySQLStartUpItem.pkg which I've installed, so I'm assuming this will take care of automatically starting the mysql server for me. Right?

    Thanks again.

  9. #9
    reads the ********* Crier silver trophybronze trophy longneck's Avatar
    Join Date
    Feb 2004
    Location
    Tampa, FL (US)
    Posts
    9,854
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    that i don't know. i say restart your pc and see what happens!

  10. #10
    SitePoint Member
    Join Date
    Mar 2007
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Unhappy exact same problem here

    Hi everybody,

    sorry that this is to be my first post round here, but i am having the exact same problems as stoavio, i want to learn rails by patrick's book, and installation was smooth and easy until i got to page 29..

    as i am a mac-newbie, this is really disgusting to me, as i don't know how to go on now... i installed mysql from "mysql-5.0.37-osx10.4-i686.dmg" and everything went fine during the installer, but the commands in the terminal, which patrick proposes, don't work.

    i don't have any other mysql-versions installed yet..

    thanx for helping out!

  11. #11
    SitePoint Member
    Join Date
    Mar 2007
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    well, adding the mysql-path to my PATH-variable as stated in the ReadMe.txt from the MySQL-installer seems to have helped..
    should have been said inside the book though..

  12. #12
    SitePoint Member
    Join Date
    Mar 2007
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    yes I had the exact same problem, page 29 in the book. I tried this from the thread and it worked:

    /usr/local/mysql/bin/mysql

  13. #13
    SitePoint Member
    Join Date
    Apr 2007
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question

    A follow-up question. I, too, was unable to use mysql or mysql5 as a command at the UNIX prompt to connect to the server.

    However, when I attempt to use '/usr/local/mysql/bin/mysql', rather than connecting to the server, I receive the following ERROR 2002 message. I've given the
    command from Lenz' book to ensure that the server is running before I attempt to connect:

    Computer:~ myhome$ ps -ax | grep mysql
    38 ?? Ss 0:00.02 /opt/local/bin/daemondo --label=mysql5 --start-cmd /o
    75 ?? S 0:00.04 /bin/sh /opt/local/lib/mysql5/bin/mysqld_safe --datad
    99 ?? S 0:01.23 /opt/local/libexec/mysqld --basedir=/opt/local --data
    Computer:~ myhome$ /usr/local/mysql/bin/mysql
    ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
    Computer:~ myhome$

    Is there something I have to do to get a "mysql.sock" file that works?

    Appreciate in advance any guidance here.

    -Ambulance_driver


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •