Bug #952 mysqld cannot change to a NIS user ID
Submitted: 30 Jul 2003 3:45 Modified: 10 Dec 2003 16:29
Reporter: Lenz Grimmer Email Updates:
Status: Won't fix Impact on me:
None 
Category:MySQL Server Severity:S2 (Serious)
Version:4.0.14 OS:Linux (Linux)
Assigned to: Michael Widenius CPU Architecture:Any

[30 Jul 2003 3:45] Lenz Grimmer
Description:
(This was reported to me via email by a customer)

It seems like mysqld has trouble switching to a user ID that is stored in NIS instead of the local user database - it dies with "Can't change to run as user 'mysql'"

MySQL 3.23 does not seem to have this problem, though.

How to repeat:
- OS: Linux-Debian
- create a NIS-User 'mysql'
- install MySQL (incl. correction of ownerships as usual)
- copy start skript mysql.server into /etc/init.d
- run "/etc/init.d/mysql.server start" as user root

The following error will show up in the Error-Log:

030729 10:37:48  mysqld started
Fatal error: Can't change to run as user 'mysql' ;  Please check that the user
exists
030729 10:37:48  Aborting
030729 10:37:48  /opt/local/mysql-standard-4.0.14-pc-linux-i686/bin/mysqld:
Shutdown
030729 10:37:48  mysqld ended
[10 Dec 2003 16:29] Michael Widenius
How did you compile MySQL ?
What binary release did you usse ?

If you are using a binary .rpm or .tar file downloaded from www.mysql.com the problem is probably that we are using a static glibc library without NIS support.

The reason for not having NIS support is that NIS can only be compiled in dynamicly in a program.

The reason for having a static binary is that this makes mysqld independent of the installed glibc library, which makes the binary more stable. It's also much easier to find and verify bugs when everyone uses an identical binary.

The fixes for this problem is:
- Compile MySQL yourself
- Add the 'mysql' user to your /etc/passwd file