Ad Widget

Collapse

SQL statement execution has failed - after reinstall version 5.4.4 - Debian 11

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • RogerCWB
    Junior Member
    • Oct 2020
    • 8

    #1

    SQL statement execution has failed - after reinstall version 5.4.4 - Debian 11

    Hi,

    I reinstalled Zabbix on a new server, version 5.4.4, but now when I try to login I get the message below on the login screen:

    SQL statement execution has failed "INSERT INTO auditlog (userid,clock,ip,action,resourcetype,note,auditid) VALUES ('3','1631722627','10.51.10.191','3','0','' ,'1')".

    Click image for larger version

Name:	Zabbix Erro 2021-09-15 143306.jpg
Views:	2451
Size:	28.8 KB
ID:	431574

    Any tips?
  • Atsushi
    Senior Member
    • Aug 2013
    • 2028

    #2
    The user you are using to connect to the database probably does not have update permissions to the database. Check the account you are using to connect and its permissions.

    Comment

    • RogerCWB
      Junior Member
      • Oct 2020
      • 8

      #3
      Originally posted by Atsushi
      The user you are using to connect to the database probably does not have update permissions to the database. Check the account you are using to connect and its permissions.
      Hi,

      When I tried:
      grant all privileges on zabbix.* to zabbix@localhost;

      I receive the error: Can't find any matching row in the user table

      Then I tried:
      create user zabbix@localhost identified by 'password';

      Then tried again grant all privileges, same error but now the users table is like that:

      +--------------+
      | User |
      +--------------+
      | zabbix |
      | usvn |
      | mariadb.sys |
      | root |
      | zabbix |
      +--------------+


      What is strange is the Database are on another server and I didn't change the rights of user zabbix.

      EDIT:

      The command is a little different on MariaDB

      grant all privileges on zabbix.* to 'zabbix'@'localhost';
      Query OK, 0 rows affected (0.006 sec)

      Now worked, but same error, I can't login even with guest account.

      EDIT PART2
      I tried the command directly on MYSQL but looks like one field is missing from the table.

      INSERT INTO auditlog (userid,clock,ip,action,resourcetype,note,auditid) VALUES ('3','1631830087','10.51.10.191','3','0','','1');
      ERROR 1054 (42S22): Unknown column 'note' in 'field list'

      Last edited by RogerCWB; 17-09-2021, 00:11.

      Comment

      • Atsushi
        Senior Member
        • Aug 2013
        • 2028

        #4
        Did you recreate the database? If you don't have column notes, it's not a database for Zabbix 5.4. Please recreate the database using the SQL statement for Zabbix 5.4.

        Comment

        • RogerCWB
          Junior Member
          • Oct 2020
          • 8

          #5
          Originally posted by Atsushi
          Did you recreate the database? If you don't have column notes, it's not a database for Zabbix 5.4. Please recreate the database using the SQL statement for Zabbix 5.4.
          If I recreate the database I will lost the data isn't?

          I installed it but I'm using the same database, I have 2 years of data.
          Last edited by RogerCWB; 17-09-2021, 15:31.

          Comment

          • Atsushi
            Senior Member
            • Aug 2013
            • 2028

            #6
            Did you upgrade from an older version? Did you manually change the database after upgrading? If you have made any changes, restore them from your backup.
            When the new version of Zabbix server starts, the database will be automatically upgraded. Please access from the new version of the web frontend after the upgrade process is complete.

            Comment

            • RogerCWB
              Junior Member
              • Oct 2020
              • 8

              #7
              Originally posted by Atsushi
              Did you upgrade from an older version? Did you manually change the database after upgrading? If you have made any changes, restore them from your backup.
              When the new version of Zabbix server starts, the database will be automatically upgraded. Please access from the new version of the web frontend after the upgrade process is complete.
              Thank you!

              It worked, I lost a few months of data but it's better than losing everything.

              Comment

              Working...