SitePoint Sponsor |
|
User Tag List
Results 1 to 13 of 13
-
Mar 6, 2007, 23:55 #1
- 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
Code:Password: sudo: /usr/local/bin/mysqld_safe5: command not found mason:~ Mason$
Code:$ sudo /Library/StartupItems/MySQLCOM/MySQLCOM start
Code:Starting MySQL database server
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
Code:-bash: bg: current: no such job
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
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
He goes on to say:
If it does, you can try to connect to your database with the following
command:Code:$ mysql5
Code:-bash: mysql5: command not found
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.
-
Mar 6, 2007, 23:57 #2
- 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'.
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>
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.
-
Mar 7, 2007, 12:30 #3
- 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)?
-
Mar 7, 2007, 13:55 #4
- Join Date
- Aug 2004
- Location
- Michigan
- Posts
- 156
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
-
Mar 7, 2007, 14:29 #5
- 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.
-
Mar 7, 2007, 17:46 #6
- 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$
Thanks!
-
Mar 7, 2007, 20:10 #7
- 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.
-
Mar 7, 2007, 21:51 #8
- 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.
-
Mar 7, 2007, 21:52 #9
- 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!
-
Mar 14, 2007, 02:29 #10
- Join Date
- Mar 2007
- Posts
- 4
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
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!
-
Mar 14, 2007, 03:05 #11
- 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..
-
Mar 25, 2007, 16:53 #12
- 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
-
Apr 8, 2007, 17:19 #13
- Join Date
- Apr 2007
- Posts
- 4
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
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