Databases Schema Wrong and failed incorrect column

librenms@bakasenchou:~$ ./validate.php

Component Version
LibreNMS 21.9.0-13-gf796396e0
DB Schema 2021_25_01_0129_isis_adjacencies_nullable (217)
PHP 7.4.3
Python 3.8.10
MySQL 10.3.31-MariaDB-0ubuntu0.20.04.1
RRDTool 1.7.2
SNMP NET-SNMP 5.8

====================================

[OK] Composer Version: 2.1.8
[OK] Dependencies up-to-date.
[WARN] You have no devices.
[FIX]:
Consider adding a device such as localhost: /addhost
[OK] Database connection successful
[FAIL] Database: incorrect column (notifications/datetime)
[FAIL] Database: incorrect column (users/created_at)
[FAIL] We have detected that your database schema may be wrong, please report the following to us on Discord (https://t.libren.ms/discord) or the community site (https://t.libren.ms/5gscd):
[FIX]:
Run the following SQL statements to fix.
SQL Statements:
SET TIME_ZONE=’+00:00’;
ALTER TABLE notifications CHANGE datetime datetime timestamp NOT NULL DEFAULT ‘1970-01-02 00:00:00’ ;
ALTER TABLE users CHANGE created_at created_at timestamp NOT NULL DEFAULT ‘1970-01-02 00:00:01’ ;

Who can help me please ?

I try to run statements in mariadb, but its wrong.

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.

MariaDB [(none)]> SET TIME_ZONE=’+00:00’;
Query OK, 0 rows affected (0.000 sec)

MariaDB [(none)]> ALTER TABLE notifications CHANGE datetime datetime timestamp NOT NULL DEFAULT ‘1970-01-02 00:00:00’ ;
ERROR 1046 (3D000): No database selected
MariaDB [(none)]> ALTER TABLE users CHANGE created_at created_at timestamp NOT NULL DEFAULT ‘1970-01-02 00:00:01’ ;
ERROR 1046 (3D000): No database selected
MariaDB [(none)]>

you need to select the librenms database first when you log into mysql.

use librenms;

then enter the commands.

Ok, thanks. I will try it.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.