How to recover the built in Directory Service data? AFAIU, OS X has a collection of built in users, and one of these users is 'mysql' user.

The reason I am making this guess is, the first time I have installed mysql server using the dmg, it installed fine. However, later I have uninstalled it and deleted mysql users. When I wanted to reinstall it later again from dmg, the installation kept failing until I recreated the 'mysql' user and 'mysql' group.

So, is there any way to recover the built in Directory Service data (such as Users, Groups, etc.)?
There is a daemon that backups the directory /private/var/db/dslocal nightly. If the backup hasn't occurred since the removal of the user then the info could be restored. The archive is /private/var/db/dslocal-backup.xar.

An alternate solution for "system" users and groups:

Rebuild the corresponding user and group plist's from /private/etc/passwd and /private/etc/group.