LiveWire Network Peer Answers Peer Support Teen Forums Tech Forums College Forums 722 users online 221599 members 1456 active today Advertise Here Sign In
TeenCollegeTechPhotos | Quizzes | LiveSecret | Memberlist | Dictionary | News | FAQ
Member Spotlight
girl22
Music: depends on the song
Mood: Wishful
You have 1 new message.
Emergency Help
Until you sign up you can't do much. Yes, it's free.

Sign Up Now
Membername:
Password:
Already have an account?
Invite Friends
Active Members
Groups
Contests
Moderators
4 online / 48 MPM
Fresh Topics
  LiveWire / Technical Forums / Programming & Application Development / Viewing Topic

Installing MySQL on a mac
Replies: 22Last Post Aug. 23, 2007 4:12pm by swya
Welcome to LiveWire!
We're Stronger Together.
Join the Community
Pages: 1 2  Next » Email Print Favorite
( ana )


Guru

Patron
Reply
I'm trying to teach myself Ruby on Rails and the book I'm using says that I need to install MySQL. The book doesn't give any instructions on how to install it as it says I should be able to download it as a .dmg (which is easy enough to work out) buuuut that only applies to PPCs and I have an Intel Mac.

The only download for an Intel mac is a TAR package which I can't install. I'm following these instructions:

Code:
A more detailed version of the preceding description for installing a
binary distribution follows:

 1. Add a login user and group for `mysqld' to run as:

         shell> groupadd mysql
         shell> useradd -g mysql mysql

    These commands add the `mysql' group and the `mysql' user. The
    syntax for `useradd' and `groupadd' may differ slightly on
    different versions of Unix, or they may have different names such
    as `adduser' and `addgroup'.

    You might want to call the user and group something else instead
    of `mysql'. If so, substitute the appropriate name in the
    following steps.

 2. Pick the directory under which you want to unpack the distribution
    and change location into it. In the following example, we unpack
    the distribution under `/usr/local'. (The instructions, therefore,
    assume that you have permission to create files and directories in
    `/usr/local'. If that directory is protected, you must perform the
    installation as `root'.)

         shell> cd /usr/local

 3. Obtain a distribution file using the instructions in *Note
    getting-mysql::. For a given release, binary distributions for all
    platforms are built from the same MySQL source distribution.

 4. Unpack the distribution, which creates the installation directory.
    Then create a symbolic link to that directory:

         shell> gunzip < /PATH/TO/MYSQL-VERSION-OS.tar.gz | tar xvf -
         shell> ln -s FULL-PATH-TO-MYSQL-VERSION-OS mysql

    The `tar' command creates a directory named `mysql-VERSION-OS'.
    The `ln' command makes a symbolic link to that directory. This
    lets you refer more easily to the installation directory as
    `/usr/local/mysql'.

    With GNU `tar', no separate invocation of `gunzip' is necessary.
    You can replace the first line with the following alternative
    command to uncompress and extract the distribution:

         shell> tar zxvf /PATH/TO/MYSQL-VERSION-OS.tar.gz

 5. Change location into the installation directory:

         shell> cd mysql

    You will find several files and subdirectories in the `mysql'
    directory. The most important for installation purposes are the
    `bin' and `scripts' subdirectories:

       * The `bin' directory contains client programs and the server.
         You should add the full pathname of this directory to your
         `PATH' environment variable so that your shell finds the MySQL
         programs properly. See *Note environment-variables::.

       * The `scripts' directory contains the `mysql_install_db'
         script used to initialize the `mysql' database containing the
         grant tables that store the server access permissions.

 6. Ensure that the distribution contents are accessible to `mysql'.
    If you unpacked the distribution as `mysql', no further action is
    required. If you unpacked the distribution as `root', its contents
    will be owned by `root'. Change its ownership to `mysql' by
    executing the following commands as `root' in the installation
    directory:

         shell> chown -R mysql .
         shell> chgrp -R mysql .

    The first command changes the owner attribute of the files to the
    `mysql' user. The second changes the group attribute to the
    `mysql' group.

 7. If you have not installed MySQL before, you must create the MySQL
    data directory and initialize the grant tables:

         shell> scripts/mysql_install_db --user=mysql

    If you run the command as `root', include the `--user' option as
    shown. If you run the command while logged in as that user, you
    can omit the `--user' option.

    The command should create the data directory and its contents with
    `mysql' as the owner.

    After creating or updating the grant tables, you need to restart
    the server manually.

 8. Most of the MySQL installation can be owned by `root' if you like.
    The exception is that the data directory must be owned by `mysql'.
    To accomplish this, run the following commands as `root' in the
    installation directory:

         shell> chown -R root .
         shell> chown -R mysql data

 9. If you want MySQL to start automatically when you boot your
    machine, you can copy `support-files/mysql.server' to the location
    where your system has its startup files. More information can be
    found in the `support-files/mysql.server' script itself and in
    *Note automatic-start::.

10. You can set up new accounts using the `bin/mysql_setpermission'
    script if you install the `DBI' and `DBD::mysql' Perl modules. See
    *Note mysql-setpermission::. For Perl module installation
    instructions, see *Note perl-support::.

11. If you would like to use `mysqlaccess' and have the MySQL
    distribution in some non-standard location, you must change the
    location where `mysqlaccess' expects to find the `mysql' client.
    Edit the `bin/mysqlaccess' script at approximately line 18. Search
    for a line that looks like this:

         $MYSQL     = '/usr/local/bin/mysql';    # path to mysql executable

    Change the path to reflect the location where `mysql' actually is
    stored on your system. If you do not do this, a `Broken pipe' error
    will occur when you run `mysqlaccess'.

After everything has been unpacked and installed, you should test your
distribution. To start the MySQL server, use the following command:

    shell> bin/mysqld_safe --user=mysql &

but they're not getting me anywhere. When I try the first thing, I get:

Code:
-bash: groupadd: command not found

and obviously that doesn't get me anywhere...

So uh, help?  


-------
Roses are #FF0000
Violets are #0000FF
I am a geek
And so are you


1:51 pm on Aug. 23, 2007 | Joined: May 2005 | Days Active: 559
Join to learn more about ana England, United Kingdom | Straight Female | Posts: 5,955 | Points: 21,511
LiveWire Humor
The Dalai Lama


Soothsayer

Patron
Reply
Those are all Unix commands that won't work on a Mac.

This should tell you how to install it.

Post edited at 1:57 pm on Aug. 23, 2007 by The Dalai Lama


1:56 pm on Aug. 23, 2007 | Joined: Oct. 2006 | Days Active: 488
Join to learn more about The Dalai Lama Ontario, Canada | Straight Male | Posts: 8,781 | Points: 12,189
swya


Dairy Product Addict

Ad Free
Reply
You may also try following the instructions on the Apple site: http://developer.apple.com/internet/opensource/osdb.html

-------
mad notes
I ♥ rickyspeople

2:06 pm on Aug. 23, 2007 | Joined: Aug. 2007 | Days Active: 54
Join to learn more about swya Nova Scotia, Canada | Straight Male | Posts: 360 | Points: 1,726
( ana )


Guru

Patron
Reply
Quote: from The Dalai Lama at 4:56 pm on Aug. 23, 2007

Those are all Unix commands that won't work on a Mac.

This should tell you how to install it.


Actually, Mac OS X = Unix

And if you'd actually read both my post and the page that you linked to, you would see that the two don't match up.

From the website:


You can install MySQL on Mac OS X 10.3.x (“Panther”) or newer using a Mac OS X binary package in PKG format instead of the binary tarball distribution. Please note that older versions of Mac OS X (for example, 10.1.x or 10.2.x) are not supported by this package.

The package is located inside a disk image (.dmg) file that you first need to mount by double-clicking its icon in the Finder. It should then mount the image and display its contents.


From my post:


I'm trying to teach myself Ruby on Rails and the book I'm using says that I need to install MySQL. The book doesn't give any instructions on how to install it as it says I should be able to download it as a .dmg (which is easy enough to work out) buuuut that only applies to PPCs and I have an Intel Mac.

The only download for an Intel mac is a TAR package which I can't install.




-------
Roses are #FF0000
Violets are #0000FF
I am a geek
And so are you

2:08 pm on Aug. 23, 2007 | Joined: May 2005 | Days Active: 559
Join to learn more about ana England, United Kingdom | Straight Female | Posts: 5,955 | Points: 21,511
bighead1991


DOESTHISRANKANNOYYOUUUUUUUUUUU

Patron
Tech Support Leader
Reply
Have a look at xampp, an automated web package.

http://www.apachefriends.org/en/xampp-macosx.html

Has a distribution for Mac OSX Intel. Nice control panels to set everything up, such as phpMyadmin for mysql. Much simpler.

Post edited at 2:11 pm on Aug. 23, 2007 by bighead1991

-------
bam.


2:11 pm on Aug. 23, 2007 | Joined: Feb. 2005 | Days Active: 1,261
Join to learn more about bighead1991 England, United Kingdom | Lesbian Male | Posts: 7,651 | Points: 37,269
( ana )


Guru

Patron
Reply
Also, swya, I've played around with those instructions a few times and they're not getting me anywhere either.

Could someone walk me through it instead of linking to irrelevant pages/instructions I'm unable to understand.

Thanks!

-------
Roses are #FF0000
Violets are #0000FF
I am a geek
And so are you


2:15 pm on Aug. 23, 2007 | Joined: May 2005 | Days Active: 559
Join to learn more about ana England, United Kingdom | Straight Female | Posts: 5,955 | Points: 21,511
The Dalai Lama


Soothsayer

Patron
Reply
Here's an intel-based .dmg version.

http://dev.mysql.com/get/Downloads/MySQL-5.0/mysql-5.0.45-osx10.4-i686.dmg/from/pick


2:16 pm on Aug. 23, 2007 | Joined: Oct. 2006 | Days Active: 488
Join to learn more about The Dalai Lama Ontario, Canada | Straight Male | Posts: 8,781 | Points: 12,189
( ana )


Guru

Patron
Reply
@bighead1991 You're blue! When did that happen? Congrats anyhow.

What you linked to would be brilliant but it comes with an enormous amount of stuff I don't need or want so I'm somewhat reluctant to install it.

-------
Roses are #FF0000
Violets are #0000FF
I am a geek
And so are you


2:17 pm on Aug. 23, 2007 | Joined: May 2005 | Days Active: 559
Join to learn more about ana England, United Kingdom | Straight Female | Posts: 5,955 | Points: 21,511
( ana )


Guru

Patron
Reply
@The Dalai Lama

Please show me the page you found that on instead of the link to the actual download. I need to check I'm downloading the right thing and not wasting my time.

-------
Roses are #FF0000
Violets are #0000FF
I am a geek
And so are you


2:20 pm on Aug. 23, 2007 | Joined: May 2005 | Days Active: 559
Join to learn more about ana England, United Kingdom | Straight Female | Posts: 5,955 | Points: 21,511
The Dalai Lama


Soothsayer

Patron
Reply
http://dev.mysql.com/downloads/mysql/5.0.html#macosx-dmg

2:22 pm on Aug. 23, 2007 | Joined: Oct. 2006 | Days Active: 488
Join to learn more about The Dalai Lama Ontario, Canada | Straight Male | Posts: 8,781 | Points: 12,189
( ana )


Guru

Patron
Reply
@ The Dalai Lama, that's no good. That's an x86 package, not a universal one.

-------
Roses are #FF0000
Violets are #0000FF
I am a geek
And so are you

2:27 pm on Aug. 23, 2007 | Joined: May 2005 | Days Active: 559
Join to learn more about ana England, United Kingdom | Straight Female | Posts: 5,955 | Points: 21,511
The Dalai Lama


Soothsayer

Patron
Reply
Why do you need a universal package if you're running an Intel-based (x86) mac?

2:30 pm on Aug. 23, 2007 | Joined: Oct. 2006 | Days Active: 488
Join to learn more about The Dalai Lama Ontario, Canada | Straight Male | Posts: 8,781 | Points: 12,189
( ana )


Guru

Patron
Reply
Because I have an Intel-based MacBook, not an Intel-based x86 PC.

http://www.apple.com/universal/

-------
Roses are #FF0000
Violets are #0000FF
I am a geek
And so are you


3:08 pm on Aug. 23, 2007 | Joined: May 2005 | Days Active: 559
Join to learn more about ana England, United Kingdom | Straight Female | Posts: 5,955 | Points: 21,511
The Dalai Lama


Soothsayer

Patron
Reply
Alright.  Well, in your first post you got the "command not found" thing.  So try doing what it says and type "addgroup mysql" instead.

3:17 pm on Aug. 23, 2007 | Joined: Oct. 2006 | Days Active: 488
Join to learn more about The Dalai Lama Ontario, Canada | Straight Male | Posts: 8,781 | Points: 12,189
swya


Dairy Product Addict

Ad Free
Reply
The link I provided you with has worked for me on several OS X installations, both ppc and x86.  What particular step did you get stuck on?  The Apple site lays out the instructions in a very nice and easy to follow order, the only draw back is their lack of "if this didn't work, try doing this to make it work..." :(

-------
mad notes
I ♥ rickyspeople

3:27 pm on Aug. 23, 2007 | Joined: Aug. 2007 | Days Active: 54
Join to learn more about swya Nova Scotia, Canada | Straight Male | Posts: 360 | Points: 1,726
Pages: 1 2  Next » Email Print Favorite

Quick Reply

You are signed in as our guest.

Looking for something else?
 

  LiveWire / Technical Forums / Programming & Application Development / Viewing Topic