This script will update a Bacula MySQL database from version 12-14
Depending on the current version of your catalog,
you may have to run this script multiple times.
ERROR 1067 (42000) at line 19: Invalid default value for 'SchedTime'
Update of Bacula MySQL tables from 12 to 13 succeeded.
Update of Bacula MySQL tables from 13 to 14 succeeded.
ERROR 1067 (42000) at line 5: Invalid default value for
ERROR 1067 (42000) at line 6: Invalid default value for
ERROR 1067 (42000) at line 7: Invalid default value for
ERROR 1067 (42000) at line 8: Invalid default value for
ERROR 1067 (42000) at line 9: Invalid default value for
ERROR 1067 (42000) at line 29: Invalid default value for 'SchedTime'
Update of Bacula MySQL tables from 14 to 15 succeeded.
After that I tried to restore a file which gave me this error in
20-Sep 13:13 backup-host-dir JobId 0: Fatal error: sql_create.c:86
Create DB Job record INSERT INTO Job
13:13:43',1474370023,128,'') failed. ERR=Incorrect datetime value:
'0000-00-00 00:00:00' for column 'StartTime' at row 1
How can I fix this?
Thanks you very much.
Mit freundlichen Gruessen / Best regards
Corporate Headquarters: Huenfelden-Dauborn Managing Director:
Registration: Amtsgericht Limburg a. d. Lahn 7HRB874 Tax ID:
This e-mail is confidential. Information in this e-mail
is intended for the exclusive use of the individual or
entity named above and may constitute information that is
privileged or confidential or otherwise protected from
disclosure. The information in this e-mail may be read,
published, copied and/or forwarded only by the individual
or entity named above. Dissemination, distribution, forwarding
or copying of this e-mail by anyone other than the
intended recipient is prohibited. If you have received this
e-mail in error, please notify us immediately by
telephone or e-mail and completely delete or destroy any and
all disseminated, distributed, forwarded electronic
or other copies of the original message and any attachments.
Re: 'Incorrect datetime value' after database update from 12 to 15
On 12/29/16 13:25, asari wrote:
> It looks like you are using relatively new MySQL server which has stricter
> http://dev.mysql.com/doc/refman/5.7/en/sql-mode.html#sql-mode-changes >
> My workaround was to dump, sed and restore from backup, i.e.:
> $ sed -e 's/0000-00-00 00:00:00/1970-01-01 00:00:00/g' \
> ... < /tmp/var/lib/bacula/bacula.sql \
> ... | mysql -ubacula -p bacula
Well, you COULD do it that way. Or you could temporarily disable
no-zero-date and no-zero-in-date in SQL_MODE, do a couple of UPDATE
operations to change all 0000-00-00 00:00:00 dates to 1970-01-01
00:00:00, and restore the original SQL_MODE.