[Koha] Backup restoring error!

Chris Cormack chris at katipo.co.nz
Mon Jan 29 21:08:11 NZDT 2007


Marty Jongepier wrote:
> 
> Running Koha-2.2.5 on Debian Sarge
> 
> Hi all, I need some help, and I think you all should be aware of this. 
> I have Koha running on 2 computers, and I regularly backup. (mysqldump
> --add-drop-table etc) I want to restore my backup from one computer on the
> other. This gives me the following error (and it also gives the error trying
> to restore the backup on the SAME computer!);
> 
> ERROR 1064 at line 21: You have an error in your SQL syntax.  Check the
> manual that corresponds to your MySQL server version for the right syntax to
> use near 'CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
>   KEY `acctsborr
> 
> When I open the file in a text editor, around line 21 it shows this;
> 
> DROP TABLE IF EXISTS `accountlines`;
> CREATE TABLE `accountlines` (
>   `borrowernumber` int(11) NOT NULL default '0',
>   `accountno` smallint(6) NOT NULL default '0',
>   `itemnumber` int(11) default NULL,
>   `date` date default NULL,
>   `amount` decimal(28,6) default NULL,
>   `description` text,
>   `dispute` text,
>   `accounttype` varchar(5) default NULL,
>   `amountoutstanding` decimal(28,6) default NULL,
>   `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update
> CURRENT_TIMESTAMP,
>   KEY `acctsborridx` (`borrowernumber`),
>   KEY `timeidx` (`timestamp`)
> ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
> 
> 
> I cannot see an error here, I am not good at mysql. Can anybody help me out
> here or point me in the right direction?
> Both computers run the same mysql version.


Hmm thats mysql 5 syntax,

Both your computers are running MySQL version 5 eh?

Heres what MySQL version 4 syntax looks like

ROP TABLE IF EXISTS `accountlines`;
CREATE TABLE `accountlines` (
   `borrowernumber` int(11) NOT NULL default '0',
   `accountno` smallint(6) NOT NULL default '0',
   `itemnumber` int(11) default NULL,
   `date` date default NULL,
   `amount` decimal(28,6) default NULL,
   `description` text,
   `dispute` text,
   `accounttype` varchar(5) default NULL,
   `amountoutstanding` decimal(28,6) default NULL,
   `timestamp` timestamp(14) NOT NULL,
   KEY `acctsborridx` (`borrowernumber`),
   KEY `timeidx` (`timestamp`)
) TYPE=MyISAM;


But if you are running version 5, then what you should have should work 
just fine. In fact I just pasted it into mysql and it worked.
So my guess is somehow you have a mysql 5 dump and are trying to import 
into mysql 4?

Chris


More information about the Koha mailing list