Subject: pkg/20205: mysqld mis-states how to set root passwd
To: None <gnats-bugs@gnats.netbsd.org>
From: None <mack@incise.org>
List: netbsd-bugs
Date: 02/04/2003 18:17:43
>Number:         20205
>Category:       pkg
>Synopsis:       mysqld pkg gives a few instructions after install, the one to set passwd is incorrect
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Feb 04 16:19:00 PST 2003
>Closed-Date:
>Last-Modified:
>Originator:     mackstann
>Release:        NetBSD 1.6
>Organization:
>Environment:
System: NetBSD incise.org 1.6 NetBSD 1.6 (GENERIC) #0: Sun Sep 8 19:43:40 UTC 2002 autobuild@tgm.daemon.org:/autobuild/i386/OBJ/autobuild/src/sys/arch/i386/compile/GENERIC i386
Architecture: i386
Machine: i386
>Description:
  paste:
  ===> Please note the following:

  If this is a new installation, please remember to set a password for
  the MySQL root user!  This is done by running both:
          /usr/pkg/bin/mysqladmin -u root -p password 'new-password'
          /usr/pkg/bin/mysqladmin -h `hostname` -u root -p password 'new-password'

neither of these are correct, i'm no advanced mysql or sql in general
user, but if you read through section 4.3.4 of the mysql manual
("Setting up the Initial MySQL Privelages"), at 
<http://www.mysql.com/doc/en/Default_privileges.html>, it states to run
  
  shell> mysql -u root mysql
  mysql> SET PASSWORD FOR root@localhost=PASSWORD('new_password');

which is correct, and works properly.  when trying the pkg-suggested
method, i just received the following:

  /usr/pkg/bin/mysqladmin: connect to server at 'localhost' failed
  error: 'Access denied for user: 'root@localhost' (Using password: YES)'

>How-To-Repeat:
  install the mysql-server pkg, and try to run the suggested command
  for setting the passwd.
>Fix:
  replace
  
    /usr/pkg/bin/mysqladmin -u root -p password 'new-password'
    /usr/pkg/bin/mysqladmin -h `hostname` -u root -p password 'new-password'

  with

    shell> mysql -u root mysql
    mysql> SET PASSWORD FOR root@localhost=PASSWORD('new_password');

  in the post-installation instructions that get printed to the screen.


>Release-Note:
>Audit-Trail:
>Unformatted: