[Koha] yet another installer problem

Roger Horne roger at hrothgar.co.uk
Mon Feb 7 11:50:55 NZDT 2005


On Sun 06 Feb, zero at vtr.net wrote:

> >ERROR 1062 at line 1: Duplicate entry 'localhost-kohaadmin' for key 1
> >256 ERROR 1062 at line 1: Duplicate entry '%-Koha-kohaadmin' for key 1
> 
> --- This error points that you have allready a user called "kohaadmin" set
> as default in a Koha  ./installer.pl  installation.
> 
> You can remove it by entering to the Mysql console and typing
> 
> DELETE FROM mysql.user WHERE User = "kohaadmin";
> 
> You may also would want to check first if the user is actually in the DB,
> can do it by:

[snip]

I am afraid that this is not the problem. I get the error constantly no
matter what state Mysql is in.

I have deleted all reference to koha from mysql using your suggestions and
also checking every mysql file.

And I have tried changing the mysql root pw to eg one that contains no
numbers. And have tried even enclosing it in quotes. And the pw works if I
type at the main system prompt mysql -p then my pw, but installer.pl refuses
to accept it.

Yes, the mysql user and db tables will get references to kohaadmin in them,
This appears to be acheived by install.pm:

	print system("$mysqldir/bin/mysql -u$mysqluser mysql -e \"insert into user
(Host,User,Password) values ('$hostname','$user',password('$pass'))\"\;");#"

	system("$mysqldir/bin/mysql -u$mysqluser mysql -e \"insert into db
(Host,Db,User,Select_priv,Insert_priv,Update_priv,Delete_priv,Create_priv,Drop_priv,
index_priv, alter_priv) values
('%','$database','$user','Y','Y','Y','Y','Y','Y','Y','Y')\"");

It seems that this is done without using the mysql root pw. Or alternatively
that that pw gets lost somewhere in the installer after these lines but
before the koha database is created. ie these lines cause kohaadmin to be
entered in the mysql.db and mysql.user tables but the koha db is not
created.

The db should be created bt the following lines which are:
	# Change to admin user login
	setmysqlclipass($pass);
	my $result=system("$mysqldir/bin/mysqladmin", "-u$user", "create",
"$database");

	if ($result) {
		showmessage(getmessage('CreatingDatabaseError'),'PressEnter', '', 1);
	} else {
		# Create the database structure
		startsysout();
		system("$mysqldir/bin/mysql -u$user $database < koha.mysql");
	}

I have tried doctoring install.pm by changing the line 
setmysqlclipass($pass); by substituting "mypw" for $pass but it
doesn't work.

> About this, you only should check your password spelling, may be you are
> entering with a different one.

I have changed the root pw to about the most simplest I could use. So I
think it unlikely I have got it wrong.

Thanks.

Roger
-- 
Roger Horne, 11 New Square, Lincoln's Inn, London WC2A 3QB
mailto:roger at hrothgar.co.uk




More information about the Koha mailing list