2021年10月8日 星期五

LibreNMS - [FAIL] Database: incorrect column (notifications/datetime) 問題修正

 LibreNMS - [FAIL]  Database: incorrect column (notifications/datetime) ( 問題修正 ) 請用本文依序操作。

輸入 ./validate.php 顯示下面問題。

[librenms@localhost ~]$ ./validate.php

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

Component | Version

--------- | -------

LibreNMS  | 21.9.1

DB Schema | 2021_25_01_0129_isis_adjacencies_nullable (217)

PHP       | 7.4.16

Python    | 3.6.8

MySQL     | 10.5.9-MariaDB

RRDTool   | 1.4.8

SNMP      | NET-SNMP 5.7.2

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


[OK]    Composer Version: 2.1.9

[OK]    Dependencies up-to-date.

[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' ;


先登入 MYSQL。( 第一個 librenms 是使用者名稱,第二個是資料庫名稱)

[librenms@localhost ~]$ mysql -u librenms -p librenms


依序輸入 validate 提供的修正指令。

MariaDB [librenms]> SET TIME_ZONE='+00:00';

Query OK, 0 rows affected (0.000 sec)


MariaDB [librenms]> ALTER TABLE `notifications` CHANGE `datetime` `datetime` timestamp NOT NULL DEFAULT '1970-01-02 00:00:00' ;

Query OK, 0 rows affected (0.071 sec)

Records: 0  Duplicates: 0  Warnings: 0


MariaDB [librenms]> ALTER TABLE `users` CHANGE `created_at` `created_at` timestamp NOT NULL DEFAULT '1970-01-02 00:00:01' ;

Query OK, 0 rows affected (0.086 sec)

Records: 0  Duplicates: 0  Warnings: 0

完成。


沒有留言:

張貼留言