Ubuntu 16.04 and Database Errors

Forum for questions and support relating to the 1.30.x releases only.
Locked
jsylvia007
Posts: 116
Joined: Wed Mar 11, 2009 8:32 pm

Ubuntu 16.04 and Database Errors

Post by jsylvia007 »

Howdy all!

My Setup:

Ubuntu 16.04
MySQL - mysqld Ver 5.7.13-0ubuntu0.16.04.2 for Linux on x86_64 ((Ubuntu))
ZoneMinder - 1.30.0

I've been running Zoneminder for years, and I'm now having an issue. The first piece is that I was noticing one of my cameras was recording events that were hours long in Modect... SO I wanted to fix that by changing the AlmRefImageBlendPct to something higher...

When I tried to edit the monitor, I got this:

Code: Select all

Can't write log entry 'INSERT INTO Logs ( TimeKey, Component, Pid, Level, Code, Message, File, Line ) values ( ?, ?, ?, ?, ?, ?, ?, ? )': SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'Message' at row 1
Additionally, I tried to run zmupdate.pl -f, and that resulted in this:

Code: Select all

Freshening configuration in database
Loading config from DB
Saving config to DB
DBD::mysql::st execute failed: Data too long for column 'DefaultValue' at row 1 at /usr/share/perl5/ZoneMinder/Config.pm line 227.
Can't execute: Data too long for column 'DefaultValue' at row 1 at /usr/bin/zmupdate.pl line 343.
Can anyone tell me what's going on? It looks to me like everything is working, but I can't make any changes for some reason.
jsylvia007
Posts: 116
Joined: Wed Mar 11, 2009 8:32 pm

[SOLVED] Ubuntu 16.04 and Database Errors

Post by jsylvia007 »

Note... Read the damn install docs here:

http://zoneminder.readthedocs.io/en/lat ... untu-16-04

I specifically missed this section:

Code: Select all


Step 3: Configure MySQL

Note

The MySQL default configuration file (/etc/mysql/mysql.cnf)is read through several symbolic links beginning with /etc/mysql/my.cnf as follows:

/etc/mysql/my.cnf -> /etc/alternatives/my.cnf
/etc/alternatives/my.cnf -> /etc/mysql/mysql.cnf
/etc/mysql/mysql.cnf is a basic file

Certain new defaults in MySQL 5.7 are currently causing some issues with ZoneMinder, the workaround is to modify the sql_mode setting of MySQL.

To better manage the MySQL server it is recommended to copy the sample config file and replace the default my.cnf symbolic link.

rm /etc/mysql/my.cnf  (this removes the current symbolic link)
cp /etc/mysql/mysql.conf.d/mysqld.cnf /etc/mysql/my.cnf
To change MySQL settings:

nano /etc/mysql/my.cnf
In the [mysqld] section add the following

sql_mode = NO_ENGINE_SUBSTITUTION

All fixed.
Locked