Database Schema issue after Time Zone update

Hey All,

I recently changed the Time Zone from UTC to CDT in our php.ini file and at the system level, and in the database. After making these changes and restarting MariaDB, along with the librenms server as a whole, I am seeing the below when validating the config in the librenms portal.

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 (LibreNMS) or the community site (Report database schema issues here - LibreNMS Community):
Fix:Run the following SQL statements to fix.

SQL Statements
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’ ;

When I run either of the commands against the librenms database, I receive the following message;

You have an error in your SQL syntax; check the manual that correstponds to your MariaDB server version for the right syntax to use near '‘users’ CHANGE ‘created_at’ ‘created_at’ timestamp NOT NULL DEFAULT ‘1970-01-…’ at line 1.

I attached a file so what I typed can be seen. I spent about 15 minutes comparing what I typed to what is generated in the “Validate Config” section. Obviously the syntax is wrong, I am just not sure what to change or what to change it to.

Everything was fine before I tried making the time zone change so that the reports we view are in the correct time zone… Any help here would be appreciated.

Wow, seems I was using the wrong kind of quote. I changed the query to use ` instead of ', and now I receive…

Unknown column ‘1970-01-02 00:00:01’ in ‘DEFAULT’

…go ahead and delete this topic/thread.

Just realized there are BOTH ` and ’ in the script. I can’t copy/paste, so typical user error here.

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