Adding MySQL user and group on Red Hat/CentOS

For the DIY folks out there!

You’re installing MySQL using the Generic Linux Binary tar ball? If you do, you’ll need to create a system user and group using useradd and groupadd. However, you would like to use the standard system IDs. No problem, Red Hat defines their standard system users and groups in their manual respectively as 27 and 27.

Here are the commands to create the system user mysql and its group mysql:

$ sudo groupadd -r -g 27 mysql
$ sudo useradd -u 27 -g 27 -r -d /var/lib/mysql -s /bin/bash mysql