Hi!
Installing the latest MySQL 4 build on Mac OS X, I got a couple of
errors when running the mysql_install_db script (sudo
./scripts/mysql_install_db) from the mysql directory:
ERROR: 1062 Duplicate entry 'localhost-root' for key 1
ERROR: 1062 Duplicate entry 'localhost-root' for key 1
This seem to be caused by line 50 and 56 in the script:
Line 49) i_u="INSERT INTO user VALUES
('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','
Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0);
Line 50) INSERT INTO user VALUES
('$hostname','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','
Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0);
Line 51)
Line 52) REPLACE INTO user VALUES
('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','
Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0);
Line 53) REPLACE INTO user VALUES
('$hostname','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','
Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0);
Line 54)
Line 55) INSERT INTO user (host,user) values ('localhost','');
Line 56) INSERT INTO user (host,user) values ('$hostname','');"
So anyone with hostname = 'localhost' seems to get the errors I got as
the combination of 'localhost' 'root' gets repeated in line 50 (see
line 49), and the combination 'localhost' '' gets repeated in line 56
(see line 55).
So no I am wondering: Why isnīt there an 'if' statement that takes of
this, something like (bear over with me, I am not super fluent it shell
scripting ;-) :
if $hostname ! "localhost"
then
i_u="INSERT INTO user VALUES
('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','
Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0);
INSERT INTO user VALUES
('$hostname','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','
Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0);
REPLACE INTO user VALUES
('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','
Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0);
REPLACE INTO user VALUES
('$hostname','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','
Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0);
INSERT INTO user (host,user) values ('localhost','');
INSERT INTO user (host,user) values ('$hostname','');"
else
i_u="INSERT INTO user VALUES
('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','
Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0);
REPLACE INTO user VALUES
('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','
Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0);
INSERT INTO user (host,user) values ('localhost','');
fi
In my opinion that would be a much gentler start for a new user with
host = 'localhost', instead of throwing a couple of errors that many
users donīt understand.
What do you think?
Best regards,
Richard Taubo
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
- Upgrade from ISAM to MyISAM fails with "read only"... Richard Taubo
- Upgrade from ISAM to MyISAM fails with "read only&... Paul Borghese
- RE: Upgrade from ISAM to MyISAM fails with "re... Paul Borghese