Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 21534 - Cannot set a root password for mysql
Summary: Cannot set a root password for mysql
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Linux MySQL bugs team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-05-23 05:48 UTC by Joseph M. Hinkle
Modified: 2003-08-27 22:00 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Joseph M. Hinkle 2003-05-23 05:48:41 UTC
After emerge mysql (3.23.56) and running the config option of the ebuild, and
starting the daemon, the directions inform the installer to set a root password:

mysqladmin -u root password 'new-password'

This will result in the error:
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user: 'root@localhost' (Using password: NO)'

An old note in the mail archives recommends using the local net name of
the machine, but that doesn't work either.

mysqladmin -u root -h darkstar password 'new-password'
results in the same error.

The phpnyadmin utility will not work as shipped because of this bug as it
expects to connect to the mysqld as "root".



Reproducible: Always
Steps to Reproduce:
1. emerge mysql

2. ebuild /var/lib/pkg/dev-db/mysql-3.23.56/mysql-3.23.56.ebuild config

3. rc-update add mysql default

4. /etc/init.d/mysql start

5. mysqladmin -u root password some_password


Actual Results:  
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user: 'root@localhost' (Using password: NO)'


Expected Results:  
It should have accepted the new password



Portage 2.0.47-r10 (default-x86-1.4, gcc-3.2.2, glibc-2.3.1-r4)
=================================================================
System uname: 2.4.20 i686 Celeron (Coppermine)
GENTOO_MIRRORS="http://gentoo.oregonstate.edu/
http://distro.ibiblio.org/pub/Linux/distributions/gentoo"
CONFIG_PROTECT="/etc /var/qmail/control /usr/kde/2/share/config
/usr/kde/3/share/config /var/bind /usr/X11R6/lib/X11/xkb
/usr/kde/3.1/share/config /usr/share/config"
CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d"
PORTDIR="/usr/portage"
DISTDIR="/usr/portage/distfiles"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR_OVERLAY=""
USE="x86 oss 3dnow apm avi crypt encode gif jpeg kde libg++ mikmod mmx motif
mpeg ncurses pdflib png quicktime spell truetype xml2 xmms xv zlib gdbm berkdb
slang readline arts svga java postgres sdl gpm tcpd pam libwww ssl python esd imlib
oggvorbis qt opengl X gtk gnome -alsa jikes usb cups tcltk perl mysql odbc
-nls"COMPILER="gcc3"
CHOST="i686-pc-linux-gnu"
CFLAGS="-O2 -mcpu=i686 -pipe"
CXXFLAGS="-O2 -mcpu=i686 -pipe"
ACCEPT_KEYWORDS="x86"
MAKEOPTS="-j2"
AUTOCLEAN="yes"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
Comment 1 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2003-05-23 13:19:27 UTC
It works here for me, with one minor change.
1. ebuild /var/db/pkg/dev-db/mysql*/*.ebuild config
2. mysqladmin -u root -h darkstar password 'new-password'
then the next instruction says:
mysqladmin -u root -h darkstar password 'new-password'
but I found I had to:
mysqladmin -u root -h darkstar -p password 'new-password'
and when prompted, enter the new-password from instruction 2.

One other thing for you to check, is if you have a pre-existing MySQL database in /var/lib/mysql.
In that case, the config does NOT overwrite it, and the old password is still in place.

Comment 2 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2003-05-26 22:46:44 UTC
waiting for a response to close this issue.
Comment 3 Joseph M. Hinkle 2003-05-27 15:35:31 UTC
That took care of it.  Thank you.
Comment 4 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2003-05-27 17:14:52 UTC
This seems to be an upstream glitch. Pending reporting to MySQL.
Comment 5 Markus Luisser 2003-06-19 01:49:16 UTC
the commands supplied here work so far as i am able to connect to the server afterwards, but 
they do not actually set a password - i am able to connect as root with an empty password and 
no password shows up in the mysql.user table... there is a thread in the forums about this: 
http://forums.gentoo.org/viewtopic.php?p=375006#375006 
Comment 6 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2003-06-19 02:07:31 UTC
slartibartfasz: run 'flush privileges;' in the mysql console after you use 'set password'.
Comment 7 Markus Luisser 2003-08-17 09:46:19 UTC
> run 'flush privileges;'

a classic - sorry! as far as i can see in the forums it seems to work now for everyone :))
Comment 8 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2003-08-27 22:00:23 UTC
user reports fixed.