List:General Discussion« Previous MessageNext Message »
From:Michael Stassen Date:April 12 2004 2:42pm
Subject:Re: install: config root user fails
View as plain text  
I have a similar setup at home, and got the same error.  See explanations 
and fixes below.

Douglas Dickinson wrote:

> warning: complete db server newbie!
> (I've done plenty of SQL & JDBC coding, but never
> had to care about the server side until now ;-)
> 
> Installed the binary distribution packages for Mac OS X:
>    mysql-max-4.0.l8.pkg
>    MySQLStartupItem.pkg
> no problem.
> 
> But then when trying to configure the root user for the
> db, cut and paste straight from Chapter 2 of the manual
> fails:

mysql_install_db created users root@localhost and root@stripped 
without paswords.  The following two mysqladmin commands are meant to set 
the passwords:

> $ mysqladmin -u root password "asdf"

Here you connect via the unix socket as root@localhost and set a password. 
Good.

> $ mysqladmin -u root -h `hostname` password "asdf"
> mysqladmin: connect to server at 'quickbeam.local' failed
> error: 'Host '192.168.1.100' is not allowed to connect to this MySQL 
> server'

Here you try to connect via tcp as root@stripped to set a password, 
but it doesn't work.  Note that mysql says "Host '192.168.1.100' is not 
allowed to connect...".  It didn't say "Host 'quickbeam.local' is not 
allowed to connect...".  That's the problem -- mysql sees the connection 
attempt as coming from 192.168.1.100 rather than quickbeam.local.  This is 
because your DNS does not equate that hostname with that IP number, which is 
to be expected with your setup (router and cable/DSL modem).

So, root@stripped still has no password, but cannot connect either. 
Fortunately, you don't really need this user.

> Please help point me in the right direction,

Connect as root@localhost with

   mysql -u root -p

You'll be prompted for the root@localhost password that you set.  At the 
mysql prompt, enter

   DELETE FROM mysql.User WHERE Host <> 'localhost';
   FLUSH PRIVILEGES;

The first line gets rid of any tcp users, such as root@stripped.
The second line makes the change take effect.

Some additional suggestions:

Enter

   GRANT ALL ON test.* to douglasdd@localhost IDENTIFIED BY 'some_password';

at the mysql prompt to create yourself as a mysql user with full access to 
the test db.  (I'm assuming your Mac username is douglasdd.  Change the 
command as necessary.)

If at some point you find that you need root to be able to connect from 
quickbeam.local via TCP, you can enter

   GRANT ALL ON *.* to root@stripped IDENTIFIED BY 'some_password';

at the mysql prompt, replacing some_password with an appropriate password.

You should probably read about the mysql privilege system in the manual:

<http://dev.mysql.com/doc/mysql/en/Privilege_system.html>
<http://dev.mysql.com/doc/mysql/en/User_Account_Management.html>

> DouglasDD

Hope that helps.

Michael

> 
> PS - I'm sure that this has come up before, but searching on list.mysql.com
> is currently broken ("DP failed" for all queries).
> 
> TONS OF DETAILS:
> 
> Mac OS X 10.3.3 (not "server" edition) on a PowerPC G5 dual 2GHz
> 
> $ uname -a
> Darwin quickbeam.local 7.3.0 Darwin Kernel Version 7.3.0: Fri Mar  5 
> 14:22:55 PST 2004; root:xnu/xnu-517.3.15.obj~4/RELEASE_PPC  Power 
> Macintosh powerpc
> 
> $ mysqladmin version
> mysqladmin  Ver 8.40 Distrib 4.0.18, for apple-darwin6.8 on powerpc
> Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
> This software comes with ABSOLUTELY NO WARRANTY. This is free software,
> and you are welcome to modify and redistribute it under the GPL license
> 
> Server version          4.0.18-max
> Protocol version        10
> Connection              Localhost via UNIX socket
> UNIX socket             /tmp/mysql.sock
> Uptime:                 40 min 30 sec
> 
> Threads: 1  Questions: 5  Slow queries: 0  Opens: 6  Flush tables: 1  
> Open tables: 1  Queries per second avg: 0.002
> 
> 
> Network: the mac is 192.168.1.100 (behind a LinkSys from the cable modem)
> 

Thread
install: config root user failsDouglas Dickinson10 Apr
  • Re: install: config root user failsMichael Stassen12 Apr