Bug #58659 minor mysql_install_db manual error
Submitted: 2 Dec 2010 14:30 Modified: 2 Dec 2010 16:20
Reporter: Andrew Hutchings Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server: Documentation Severity:S3 (Non-critical)
Version:5.5.7 OS:Any
Assigned to: CPU Architecture:Any

[2 Dec 2010 14:30] Andrew Hutchings
Description:
http://dev.mysql.com/doc/refman/5.5/en/mysql-install-db.html:

"The login user name to use for running mysqld. Files and directories created by mysqld will be owned by this user. You must be root to use this option. By default, mysqld runs using your current login name and files and directories that it creates will be owned by you. "

In MySQL 5.5.7 you are now required to have a 'mysql' system user and I assume the tool now tries to own everything as that.  This can be overridden with --user=your_username

How to repeat:
See description.
[2 Dec 2010 15:44] Sveta Smirnova
Thank you for the report.

> in MySQL 5.5.7 you are now required to have a 'mysql' system user

Where have you found such requirement? See mysql_install_db running in my environment for user ssmirnova:

$./scripts/mysql_install_db --basedir=. --datadir=./bug58659
Installing MySQL system tables...
OK
Filling help tables...
OK

To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:

./bin/mysqladmin -u root password 'new-password'
./bin/mysqladmin -u root -h blade12.mysql.com password 'new-password'

Alternatively you can run:
./bin/mysql_secure_installation

which will also give you the option of removing the test
databases and anonymous user created by default.  This is
strongly recommended for production servers.

See the manual for more instructions.

You can start the MySQL daemon with:
cd . ; ./bin/mysqld_safe &

You can test the MySQL daemon with mysql-test-run.pl
cd ./mysql-test ; perl mysql-test-run.pl

Please report any problems with the ./scripts/mysqlbug script!
[2 Dec 2010 15:51] Andrew Hutchings
On a Fedora 14 installation:

[linuxjedi@linuxjedi-laptop mysql-5.5]$ /home/linuxjedi/Programming/Builds/mysql-5.5.7/scripts/mysql_install_db --datadir=. --basedir=/home/linuxjedi/Programming/Builds/mysql-5.5.7/
chown: invalid user: `mysql'
Cannot change ownership of the database directories to the 'mysql'
user.  Check that you have the necessary permissions and try again.

This doesn't happen with 5.1.
[2 Dec 2010 16:08] Sveta Smirnova
Thank you for the feedback.

Do you have option user=mysql in the configuration file? Will mysql_install_db --no-defaults work?
[2 Dec 2010 16:13] Andrew Hutchings
wow, ok, I didn't realise I had a my.cnf lying around in /etc until you just pointed that out.  I wonder why 5.1 doesn't read it then.  Oh well :)

Please close as !Bug then :)
[2 Dec 2010 16:20] Sveta Smirnova
Thank you for the feedback.

Closed as "Not a Bug"