Bug #3640 chown to 'mysql' user occurs during initial installation and startup
Submitted: 3 May 2004 22:50 Modified: 10 Jun 2004 13:56
Reporter: Peter Kazmir Email Updates:
Status: Closed Impact on me:
Category:MySQL Server Severity:S3 (Non-critical)
Version:4.0.18-pro OS:IBM AIX (AIX (at least))
Assigned to: Sergei Golubchik CPU Architecture:Any

[3 May 2004 22:50] Peter Kazmir
When we install MySQL on a unix system, we unpack the tarball, start the server as "root" to grant privileges to a specific user (usually "mysql" but not always), stop it, chown everything in the install directory to the specific user from above, create a .cnf file (which lists that user as the user variable in the client and server sections), and then start it using mysqld_safe and the .cnf file. When mysqld_safe runs, it prints the following error:

   chown: 3002-131 mysql is an unknown username.

...if the user we have chosen to be the "administrator" (and the file owner) is not "mysql" and there is no "mysql" user on the system.

It doesn't hurt anything but it could mislead someone checking our logs when they see this erroneous error message about chowning.

How to repeat:
Install and configure MySQL server on a system without a user named "mysql".

Suggested fix:
Use the --user arguement for the chown command instead of having "mysql" hardcoded.
[14 May 2004 16:05] Peter Kazmir
FYI, I noticed that this appears to be the chown call for the .err file. If there *is* a mysql user (and you're not using it, using a different non-root user instead), then the non-root user won't be able to access the .err file and the server may not start up.
[9 Jun 2004 14:31] Michael Widenius
Fix: copy user from the [server] section to the [mysqld_safe] section in the my.cnf file.

The reason for mysqld_safe not using the user argument from the [mysqld] section can be found in the bug report #2163
[10 Jun 2004 13:56] Sergei Golubchik
Thank you for your bug report. This issue has been committed to our
source repository of that product and will be incorporated into the
next release.

If necessary, you can access the source repository and build the latest
available version, including the bugfix, yourself. More information 
about accessing the source trees is available at

Additional info:

fixed in 4.0.21