Bug #31323 Installation instructions
Submitted: 1 Oct 2007 17:38 Modified: 31 Jul 2008 1:32
Reporter: Allan Jacobs Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Documentation Severity:S3 (Non-critical)
Version:5.0, 5.1, 4.1 OS:Linux
Assigned to: Paul DuBois CPU Architecture:Any

[1 Oct 2007 17:38] Allan Jacobs
Description:
Section 2.4.16.3 describes a process for setup that leaves a security hole.  It
instructs the person installing the database to execute the following
two commands:

mysql> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('newpwd');
mysql> SET PASSWORD FOR 'root'@'host_name' = PASSWORD('newpwd');

I think this leaves an account root@127.0.0.1 unprotected.

mysql> select host,user,password from user;
+----------------+-----------------+-------------------------------------------+
| host           | user            | password                                  |
+----------------+-----------------+-------------------------------------------+
| localhost      | root            | *59E8BDD7D7C01F8BA2CD25A6C4DA8380BAAC6196 | 
| ajacobs-ubuntu | root            | *59E8BDD7D7C01F8BA2CD25A6C4DA8380BAAC6196 | 
| 127.0.0.1      | root            |                                           | 
| localhost      | debian-sys-maint| *1A1C7F99FC38AACD1C2D4E6F7AFD446C0A3CA924 | 
+----------------+-----------------+-------------------------------------------+

The documentation should say that Unix database installations should run

mysql> SET PASSWORD FOR 'root'@'127.0.0.1' = PASSWORD('newpwd');

as well.

Anonymous accounts are broken on Linux.  When that feature is patched or
fixed in a new release, the documentation for anonymous accounts will probably
have to get changed as well.

How to repeat:
Read the manual page

MySQL 5.0 Reference Manual :: 2 Installing and Upgrading MySQL :: 2.4 Installing MySQL Community Server :: 2.4.16 Post-Installation Setup and Testing :: 2.4.16.3 Securing the Initial MySQL Accounts

Install a server and follow directions. Start up mysql from the command line
using
% mysql -u root -p
Then exec the commands
mysql> use mysql
mysql> select host,user,password from user;

Suggested fix:
The documentation Section 2.4.16.3 should say that Unix server installations
should run

mysql> SET PASSWORD FOR 'root'@'127.0.0.1' = PASSWORD('newpwd');

as well.

It is likely that the section that talks about anonymous accounts should
recommend

mysql> SET PASSWORD FOR ''@'127.0.0.1' = PASSWORD('newpwd');
[11 Oct 2007 11:08] Sveta Smirnova
Thank you for the report.

Verified as described.
[31 Jul 2008 1:32] 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.

Modified 5.0, 5.1, and 6.0 manuals.  4.1 does not appear to have the root@127.0.0.1 account.