Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

groupadd on bash

87 views
Skip to first unread message

JRough

unread,
Jan 26, 2009, 2:18:09 PM1/26/09
to
I am installing mysql binaries on my mac. The first instruction says
to add a mysql group at the shell. It is the bash shell. There does
not appear to be a addgroup command. I found a setgroups command but
it didn't work.

j-rs-computer:/Users/jr root# sudo su
j-rs-computer:/Users/jr root# setgroups mysql
su: setgroups: command not found
j-rs-computer:/Users/jr root# groupadd mysql
su: groupadd: command not found
j-rs-computer:/Users/jr root#

I also tried:
j-rs-computer:/applications root# /bin/bash
j-rs-computer:/applications root# groupadd mysql
bash: groupadd: command not found

Can you tell me how to add a group?

By the way, after you do sudo su to be the root user how do you switch
back to the regular user?
thanks,

Joachim Schmitz

unread,
Jan 26, 2009, 2:27:32 PM1/26/09
to
JRough wrote:
> I am installing mysql binaries on my mac. The first instruction says
> to add a mysql group at the shell. It is the bash shell. There does
> not appear to be a addgroup command. I found a setgroups command but
> it didn't work.
>
> j-rs-computer:/Users/jr root# sudo su
> j-rs-computer:/Users/jr root# setgroups mysql
> su: setgroups: command not found
> j-rs-computer:/Users/jr root# groupadd mysql
> su: groupadd: command not found
> j-rs-computer:/Users/jr root#
>
> I also tried:
> j-rs-computer:/applications root# /bin/bash
> j-rs-computer:/applications root# groupadd mysql
> bash: groupadd: command not found
>
> Can you tell me how to add a group?

manually by editing /etc/groups

> By the way, after you do sudo su to be the root user how do you switch
> back to the regular user?

exit

> thanks,

Message has been deleted

Joachim Schmitz

unread,
Jan 26, 2009, 3:48:01 PM1/26/09
to
JRough wrote:
> On Jan 26, 11:27 am, "Joachim Schmitz" <nospam.j...@schmitz-
> I looked in there and this is what is there:
> nobody:*:-2:
> nogroup:*:-1:
> wheel:*:0:root
> daemon:*:1:root
> kmem:*:2:root
> sys:*:3:root
> tty:*:4:root
> operator:*:5:root
> mail:*:6:
> bin:*:7:
> staff:*:20:root
> lp:*:26:
> postfix:*:27:
> postdrop:*:28:
> certusers:*:29:root,jabber,postfix,cyrusimap
> "/etc/group" 46L, 882C
>
> where/how would I add the mysql group in this list?

add/append a line

mysql:*:30:

> because my instructions say to add it at the shell?
>
> shell> groupadd mysql
> thanks,

Keith Thompson

unread,
Jan 26, 2009, 4:00:04 PM1/26/09
to

I don't know where MacOS puts the groupadd command, or whether it
calls it something else. (On my Linux box, it's /usr/sbin/groupad,
but that probably doesn't help you much.)

There's probably a way to add a group through the GUI. Yes, your
instructions say to do it at the shell, but don't worry about that; it
shouldn't matter how the group is created.

--
Keith Thompson (The_Other_Keith) ks...@mib.org <http://www.ghoti.net/~kst>
Nokia
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"

Message has been deleted

JRough

unread,
Jan 26, 2009, 4:43:54 PM1/26/09
to
On Jan 26, 12:48 pm, "Joachim Schmitz" <nospam.j...@schmitz-

I got it, that was a little scary. I forgot my root password for a
minute. Now I have to add a mysql user. My guess is
mysql:*:30:mysql
is that right?

thanks and regards,
janis

Harry

unread,
Jan 26, 2009, 5:05:52 PM1/26/09
to
On Jan 26, 1:43 pm, JRough <jlro...@yahoo.com> wrote:

> I got it, that was a little scary.  I forgot my root password for a
> minute.  Now I have to add a mysql user.  My guess is
> mysql:*:30:mysql
> is that right?

Hang yourself out in a mac discussion forum.

Add a New User
http://www.osxfaq.com/tips/unix-tricks/week91/wednesday.ws

good luck

Joachim Schmitz

unread,
Jan 26, 2009, 5:24:57 PM1/26/09
to
JRough wrote:
> On Jan 26, 12:48 pm, "Joachim Schmitz" <nospam.j...@schmitz-
> Can someone help me? I cannot do sudo su anymore and become "root".
> j-rs-computer:/etc jr$ sudo su
> Password:
> Sorry, try again.
> I don't understand how adding the line below could have changed my
> root user but did I accidentally damage /etc/group? It looks okay
> except for the last line.
> Is group 100 a bad number or something? I hope you can' help me out
> of this,.
> I added a line in /etc/group and now I cannot switch user.
> this line was a guess. I tried to change it like what you have above
> but it is read only since I can't login as root anymore.
> mysql:*:100:mysql

I said to add
mysql:*:30:
didn't I?
That extry mysql at the end refers to a user amed mysql, does that exist?

Cydrome Leader

unread,
Jan 30, 2009, 12:30:42 AM1/30/09
to
Keith Thompson <ks...@mib.org> wrote:
> JRough <jlr...@yahoo.com> writes:
>> I am installing mysql binaries on my mac. The first instruction says
>> to add a mysql group at the shell. It is the bash shell. There does
>> not appear to be a addgroup command. I found a setgroups command but
>> it didn't work.
>>
>> j-rs-computer:/Users/jr root# sudo su
>> j-rs-computer:/Users/jr root# setgroups mysql
>> su: setgroups: command not found
>> j-rs-computer:/Users/jr root# groupadd mysql
>> su: groupadd: command not found
>> j-rs-computer:/Users/jr root#
>>
>> I also tried:
>> j-rs-computer:/applications root# /bin/bash
>> j-rs-computer:/applications root# groupadd mysql
>> bash: groupadd: command not found
>>
>> Can you tell me how to add a group?
>>
>> By the way, after you do sudo su to be the root user how do you switch
>> back to the regular user?
>> thanks,
>
> I don't know where MacOS puts the groupadd command, or whether it

It doesn't have one- this is a BSD-ism.

> calls it something else. (On my Linux box, it's /usr/sbin/groupad,
> but that probably doesn't help you much.)

You can add and remove groups through netinfo, use niload and nidump. The
behavior goes back to the NeXT days.

> There's probably a way to add a group through the GUI. Yes, your
> instructions say to do it at the shell, but don't worry about that; it
> shouldn't matter how the group is created.

If there's still a gui for browsing the netinfo db, you can do it there.


0 new messages