Uploaded image for project: 'ZABBIX FEATURE REQUESTS'
  1. ZABBIX FEATURE REQUESTS
  2. ZBXNEXT-10012

Zabbix MySQL monitoring doesn't work on MySQL 8.4

XMLWordPrintable

    • Icon: Change Request Change Request
    • Resolution: Unresolved
    • Icon: High High
    • None
    • 6.0.40, 7.0.12, 7.2.6
    • Agent2 (G)
    • None
    • Zabbix Server/Proxy/Agent2 version 7.0.12

      When trying to monitor (Percona) MySQL 8.4 replication using the built-in MySQL plugin and the "MySQL by Zabbix Agent 2" template we get an error:

      2025/05/16 09:50:45.369228 [Mysql] Cannot fetch data: Error 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SLAVE STATUS' at line 1. 

      This makes sense as the 'SHOW SLAVE STATUS' command has been deprecated in MySQL 8.0.22 and has been removed in 8.4.

      The correct syntax to use on recent MySQL instances is

      SHOW REPLICA STATUS;

      The output is largely still the same, apart from the fact that the word 'slave' has been replaced by 'replica' everywhere.

      Example output on MySQL 8.4.4:

       

       

      mysql> SHOW REPLICA STATUS\G
      *************************** 1. row ***************************
                   Replica_IO_State: Waiting for source to send event
                        Source_Host: db-test002
                        Source_User: replication
                        Source_Port: 3306
                      Connect_Retry: 60
                    Source_Log_File: binlog.000003
                Read_Source_Log_Pos: 69400133
                     Relay_Log_File: db-test001-relay-bin.000008
                      Relay_Log_Pos: 1116953
              Relay_Source_Log_File: binlog.000003
                 Replica_IO_Running: Yes
                Replica_SQL_Running: Yes
                    Replicate_Do_DB:
                Replicate_Ignore_DB:
                 Replicate_Do_Table:
             Replicate_Ignore_Table:
            Replicate_Wild_Do_Table:
        Replicate_Wild_Ignore_Table:
                         Last_Errno: 0
                         Last_Error:
                       Skip_Counter: 0
                Exec_Source_Log_Pos: 999999
                    Relay_Log_Space: 1320102
                    Until_Condition: None
                     Until_Log_File:
                      Until_Log_Pos: 0
                 Source_SSL_Allowed: No
                 Source_SSL_CA_File:
                 Source_SSL_CA_Path:
                    Source_SSL_Cert:
                  Source_SSL_Cipher:
                     Source_SSL_Key:
              Seconds_Behind_Source: 0
      Source_SSL_Verify_Server_Cert: No
                      Last_IO_Errno: 0
                      Last_IO_Error:
                     Last_SQL_Errno: 0
                     Last_SQL_Error:
        Replicate_Ignore_Server_Ids:
                   Source_Server_Id: 123456789
                        Source_UUID: 4h56eaa1-9954-11f0-8f10-0050ecf3fc
                   Source_Info_File: mysql.slave_master_info
                          SQL_Delay: 0
                SQL_Remaining_Delay: NULL
          Replica_SQL_Running_State: Replica has read all relay log; waiting for more updates
                 Source_Retry_Count: 10
                        Source_Bind:
            Last_IO_Error_Timestamp:
           Last_SQL_Error_Timestamp:
                     Source_SSL_Crl:
                 Source_SSL_Crlpath:
                 Retrieved_Gtid_Set: 4h56eaa1-9954-11f0-8f10-0050ecf3fc:1-1642
                  Executed_Gtid_Set: 3e17a135-b21f-11ef-8253-005056a6e3fc:1-246,
      4fe736a8-319b-11f0-9a86-005056a6e3fc:1-1642,
      93e5f697-b09b-11ef-945a-005056a6f7d2:1-21946840
                      Auto_Position: 1
               Replicate_Rewrite_DB:
                       Channel_Name:
                 Source_TLS_Version:
             Source_public_key_path:
              Get_Source_public_key: 1
                  Network_Namespace:
      1 row in set (0.00 sec) 

      Are there plans to fully support MySQL 8.4? It's the most recent LTS version and has been out since 2024-04-30. As monitoring replication status is

       

            zit Zabbix Integration Team
            jmaes Jeremy Maes
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: