On 08/02/18 10:39, Tilman Schmidt wrote: > Just a quick note to help narrowing this down: > * I'm experiencing this "Field 'StartTime' doesn't have a default value" > error on an openSUSE installation ever since it was upgraded to Leap 42.3 and > Bacula 9. > * The machine in question runs MySQL, not MariaDB, even though openSUSE has > deprecated MySQL. > * Getting MySQL to run caused a lot of pain, mostly related to systemd. > * Your on your own with that. openSUSE answers all requests on that topic > with: "We don't support MySQL - use MariaDB." > * Luckily on that machine the "no default value" error only strikes when I > try to label a new volume. > * The few times this has occurred I fixed it by performing the failed > database INSERT manually and adding explicit values for all the DATETIME > fields. > > All from memory. I'll gladly post details next time I get to the affected > machine. > > HTH > Tilman
Tilman, What MySQL version are you running? I'm going to assume it is properly tuned in the first place. If you are running MySQL 5.7 or later, you may need to do two things: 1. Change the SQL_MODE configuration variable to remove the term NO_ZERO_DATE and NO_ZERO_IN_DATE 2. Modify the schemas to either add a valid DEFAULT for all columns declared NOT NULL without a DEFAULT (except for BLOB, TEXT, and ENUM types, for which DEFAULT is not applicable), or remove the NOT NULL. The correct SQL99-compliant default DATETIME is the start of the Unix epoch, '1970-01-01 00:00:00'. However, there are one or two places in Bacula's code that depend upon the default DATETIME being '0000-00-00 00:00:00', which is not valid under SQL99 (because there is no year 0, month 0, or day 0 in the calendar), which is why you need to remove NO_ZERO_DATE and NO_ZERO_IN_DATE from SQL_MODE. -- Phil Stracchino Babylon Communications ph...@caerllewys.net p...@co.ordinate.org Landline: +1.603.293.8485 Mobile: +1.603.998.6958 ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ Bacula-users mailing list Bacula-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bacula-users