Get back the ‘mysql’ user

July 15, 2005 – 02:21 | LAMP

For some reason, after I upgraded from mysql 3.23 to 4.1 using the rpms, mysql refused to start, with this error message:

[ERROR] Fatal error: Can't change to run as user 'mysql' ; Please check that the user exists!

All the files mysql used to work with happily(like the data files) now only have 27 for both the owner and group. Apparently for some reason rpm decided to remove the 'mysql' user & group as part of the upgrading procedure. Here are the two commands that fixed everything (the same uid and gid is reused so I don't have to cd around and do a bunch of adhoc chown's and chgrp's:

CODE:
  1. groupadd -g 27 mysql
  2. adduser -s /sbin/nologin -m -u 27 -g mysql mysql

Trackback from your site, or follow the comments in RSS.

Post a Comment