[Koha] Re: Database Erro installing Koha
Kochin Chang
kochinc at yahoo.com
Tue Sep 5 04:50:23 NZST 2006
Hi Oindrila,
I am not Chris, but I got those same errors when running Koha v2.2.5 and
later Koha v2.2.6RC2.
The first problem you had already solved. The second problem, "Invalid
default value", was caused by the syntax changes in MySQL v5.0. Ubuntu
6.06 has MySQL v5.0.22. In MySQL v5.0 any field with AUTO_INCREMENT is
not allowed to have a DEFAULT value. Both 'aqbudgetid' and 'id' fields
have AUTO_INCREMENT option set. Yet the program also tries to set
default values for them. The solution is not to use DEFAULT when
AUTO_INCREMENT is set.
--- updatedatabase.orig 2005-12-30 06:13:29.000000000 -0500
+++ updatedatabase 2006-09-04 12:42:31.000000000 -0400
@@ -1164,8 +1164,10 @@
if ( $key eq 'PRI' ) {
$key = 'PRIMARY KEY';
}
+ my $default_opt = '';
unless ( $extra eq 'auto_increment' ) {
$extra = '';
+ $default_opt = 'DEFAULT ?';
}
# if it's a new column use "add", if it's an
old one, use "change".
@@ -1178,11 +1180,16 @@
# if it's a primary key, drop the previous pk, before altering the table
my $sth;
if ($key ne 'PRIMARY KEY') {
- $sth =$dbh->prepare("alter table $table
$action $field $type $null $key $extra default ?");
+ $sth =$dbh->prepare("alter table $table
$action $field $type $null $key $extra $default_opt");
} else {
- $sth =$dbh->prepare("alter table $table
drop primary key, $action $field $type $null $key $extra default ?");
+ $sth =$dbh->prepare("alter table $table
drop primary key, $action $field $type $null $key $extra $default_opt");
+ }
+ if ( $default_opt eq '' ) {
+ $sth->execute();
+ }
+ else {
+ $sth->execute($default);
}
- $sth->execute($default);
print " Alter $field in $table\n" unless $silent;
}
}
On the third problem I can only provide guesses: Is Apache listening on
port 8000? Is there any firewall blocking that port?
Regards,
Kochin Chang
Oindrila Mukherjee wrote:
> Hi Chris,
>
> I'm trying to install Koha ver 2.2.5 on Ubuntu Linux. However I'm having
> some problems while running the installer.pl.
>
> The initial errors got fixed by putting the backquotes over "return"
> keyword in the sql syntax in koha.mysql. But now I'm getting these errors:
>
> DBD::mysql::st execute failed: Invalid default value for 'aqbudgetid' at
> scripts/updater/updatedatabase line 1185.
> DBD::mysql::st execute failed: Invalid default value for 'id' at
> scripts/updater/updatedatabase line 1185.
> synch'ing borrowers
> creating column textmessaging
> creating column password
> creating column flags
> creating column userid
> creating column homezipcode
> creating column zipcode
> creating column sort1
> creating column sort2
> synch'ing items
> creating column itemcallnumber
> synch'ing biblio
> synch'ing biblioitems
> creating column place
>
> Also the opac interface does not seem to be running. I mean when I do
> "http://localhost:8000" ...it gives me an error saying "Unable to
> connect..." . The other applications running on localhost seem to be
> working fine. I used port 8000 because http is running on port 80 ... is
> that a problem?
>
> Could you please help me out? I've been trying hard to make this work.
> Some advice would be really helpful.
>
> Thanks,
> Oindrila
More information about the Koha
mailing list