KKoPV / PVLng

PhotoVoltaic Logger new generation, a logging and data warehouse system for measuring data of sensors and photovoltaic plants, see
http://pvlng.com
Other
8 stars 2 forks source link

Install: SQL error Field 'serial' doesn't have a default value #35

Closed andig closed 8 years ago

andig commented 9 years ago

I'm trying to run the installation according to http://pvlng.com/Core_repository_installation_instructions

During SQL import from sql/pvlng.sql, the following error is raised:

INSERT INTO `pvlng_channel` (`id`, `name`, `description`, `type`, `resolution`, `unit`, `decimals`, `meter`, `cost`, `threshold`, `valid_from`, `valid_to`, `extra`) VALUES (1, 'DO NOT TOUCH', 'Dummy for tree root', 0, 0, '', 2, 0, 0, NULL, NULL, NULL, ''), (2, 'RANDOM Temperature sensor', '15 ... 25, ±0.1', 10, 1, '°C', 1, 0, 0, 0.1, 15, 25, ''), (3, 'RANDOM Energy meter', '0 ... ∞, +0.05', 10, 1000, 'Wh', 0, 1, 0.0002, 0.05, 0, 10000000000, ''), (4, 'Dashboard', 'Dashboard group', 5, 1, '', 2, 0, 0, NULL, NULL, NULL, ''), (5, 'Temperature sensor', 'RANDOM Temperature sensor for Dashboard', 30, 1, '°C', 1, 0, 0, NULL, 0, 40, '\"> 10 : #BFB\\n10 > 20 : #FFB\\n20 > : #FBB\"'), (6, 'Calculations', 'Group for separation of real channels from calculations', 5, 1, '', 2, 0, 0, NULL, NULL, NULL, '')  
Error Code: 1364. Field 'serial' doesn't have a default value   0.000 sec

More errors for columns on the same table, then same problem on pvlng_tree, pvlng_view and pvlng_dashboard:

INSERT INTO `pvlng_tree` (`id`, `lft`, `rgt`, `entity`) VALUES (1, 1, 12, 1), (2, 2, 3, 2), (3, 4, 5, 3), (4, 6, 11, 4), (5, 7, 10, 5), (6, 8, 9, 2)    
Error Code: 1364. Field 'moved' doesn't have a default value    0.000 sec

INSERT INTO `pvlng_view` (`name`, `public`, `data`) VALUES ('Demo', 1, '{\"2\":\"{\\\"v\\\":2,\\\"axis\\\":1,\\\"type\\\":\\\"spline\\\",\\\"style\\\":\\\"Solid\\\",\\\"width\\\":2,\\\"color\\\":\\\"#4572a7\\\",\\\"colorusediff\\\":1,\\\"colordiff\\\":\\\"#db843d\\\",\\\"consumption\\\":false,\\\"threshold\\\":20,\\\"min\\\":false,\\\"max\\\":false,\\\"last\\\":false,\\\"all\\\":false,\\\"time1\\\":\\\"00:00\\\",\\\"time2\\\":\\\"24:00\\\",\\\"legend\\\":true,\\\"position\\\":0}\",\"3\":\"{\\\"v\\\":2,\\\"axis\\\":2,\\\"type\\\":\\\"areaspline\\\",\\\"style\\\":\\\"Solid\\\",\\\"width\\\":2,\\\"color\\\":\\\"#89a54e\\\",\\\"colorusediff\\\":0,\\\"colordiff\\\":\\\"#404040\\\",\\\"consumption\\\":false,\\\"threshold\\\":0,\\\"min\\\":false,\\\"max\\\":false,\\\"last\\\":false,\\\"all\\\":false,\\\"time1\\\":\\\"00:00\\\",\\\"time2\\\":\\\"24:00\\\",\\\"legend\\\":true,\\\"position\\\":0}\",\"p\":\"1i\"}')   
Error Code: 1364. Field 'slug' doesn't have a default value 0.016 sec

INSERT INTO `pvlng_dashboard` (`name`, `public`, `data`) VALUES ('Demo', 1, '[5]')  
Error Code: 1364. Field 'slug' doesn't have a default value 0.016 sec
K-Ko commented 9 years ago

There is a issue from MySQL 5.6, there is as a default STRICT_TRANS_TABLES set. (1, 2)

As workaround until I fixed the SQL script, you can change your MySQL settings like this

sql-mode="...,STRICT_TRANS_TABLES,..."

remove at least the STRICT_TRANS_TABLES and restart the MySQL server.

andig commented 9 years ago

Workaround confirmed.