Bug #22835 Errors when running mysql_install_db script during binary installation
Submitted: 29 Sep 2006 18:00 Modified: 8 Mar 2007 14:47
Reporter: Erica Moss Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Documentation Severity:S2 (Serious)
Version:5.0.24a GA non-rpm OS:Linux (Fedora core 5)
Assigned to: Paul DuBois CPU Architecture:Any

[29 Sep 2006 18:00] Erica Moss
Description:
During a first time binary install, this script was run according to our manual.  Because it was not specified that I should extract the binary archive as any particular user, I just did it as myself.  Then when the script was run as user mysql as per the instuctions, it failed:

[mysql@localhost mysql]$ ./scripts/mysql_install_db
mkdir: cannot create directory `./data/mysql': Permission denied
chmod: cannot access `./data/mysql': Permission denied
mkdir: cannot create directory `./data/test': Permission denied
chmod: cannot access `./data/test': Permission denied
Installing all prepared tables
060929 12:50:12 [Warning] Can't create test file /usr/local/mysql-max-5.0.24a-linux-i686-icc-glibc23/data/localhost.lower-test
./bin/mysqld: Can't change dir to '/usr/local/mysql-max-5.0.24a-linux-i686-icc-glibc23/data/' (Errcode: 13)
060929 12:50:12 [ERROR] Aborting
060929 12:50:12 [Note] ./bin/mysqld: Shutdown complete
Installation of system tables failed!

If I extract the archive as user mysql, then this script will run properly.  Alternatively if I run the script as root it works:
./scripts/mysql_install_db --user=mysql

The docs should be modified to either instruct the user to create user mysql first, and then extract the archive, or remove the statements that suggest that this script can be run as user mysql.

How to repeat:
Follow instructions at:
http://dev.mysql.com/doc/refman/5.0/en/installing-binary.html
[8 Mar 2007 14:47] Paul DuBois
Thank you for your bug report. This issue has been addressed in the documentation. The updated documentation will appear on our website shortly, and will be included in the next release of the relevant products.
[15 Feb 2010 15:21] Bernard Leung
Hi, has this problem been reported and fixed in 5.1 documentation also? I've got the same problem with 5.1 on OSX, and it's causing me some grief. I tried running mysql_install_db under sudo, and even though that runs mysql still won't run and I can't access the data directory - for whatever reason the mysql directory is owned by root, but the data directory that was created is owned by _mysql, and I can't get access to that directory?!? Weird... Help welcome!