Surprisingly, it's been tough for me to find the command(s) to do this. Does anyone know how to add a group? Thanks!
Or do something like this:
# create the MySQL group
dscl . create /Groups/mysql
# give it some group id
dscl . create /Groups/mysql gid 296
"System preferences" -> "Users&Groups" -> "+" (as if you were adding new account) -> Under "New account" select "Group" -> Type in group name -> "Create group"
I've used these to add dba group:
pulegium's answer is generally preferred, but if you want a command-line way:
(note that creating a group named mysql is probably a bad idea -- there's already a group named _mysql, with mysql as an alias.)
As Gordon Davisson notes, standard Mac OS X 10.6 already has a mysql group, as this command shows:
You shouldn’t create your own mysql group, and any attempts to modify it will affect the _mysql group. But to answer your question, the most succinct way to do it would be this single command:
To add an encrypted password to the group:
Note: Andrea Girardi’s method creates a plaintext password, which isn’t so good.