mysql script problem with PHP8.1
NightowlKr opened this issue · 0 comments
NightowlKr commented
Hello!
I try to update mysql snmp but it have this error.
Anyone got an idea?
mysql script error code #1
librenms@NMS60:/opt/librenms-agent$ /usr/lib/check_mk_agent/local/mysql
<<<mysql>>>
PHP Fatal error: Uncaught mysqli_sql_exception: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'NONBLOCKING' at line 1 in /usr/lib/check_mk_agent/local/mysql:1307
Stack trace:
#0 /usr/lib/check_mk_agent/local/mysql(1307): mysqli_query()
#1 /usr/lib/check_mk_agent/local/mysql(416): run_query()
#2 /usr/lib/check_mk_agent/local/mysql(135): ss_get_mysql_stats()
#3 {main}
thrown in /usr/lib/check_mk_agent/local/mysql on line 1307
mysql script error code #2 : add option $chk_options['slave'] = false; in mysql.cnf
librenms@NMS60:/opt/librenms-agent$ /usr/lib/check_mk_agent/local/mysql
<<<mysql>>>
PHP Fatal error: Uncaught mysqli_sql_exception: Access denied; you need (at least one of) the PROCESS privilege(s) for this operation in /usr/lib/check_mk_agent/local/mysql:1307
Stack trace:
#0 /usr/lib/check_mk_agent/local/mysql(1307): mysqli_query()
#1 /usr/lib/check_mk_agent/local/mysql(533): run_query()
#2 /usr/lib/check_mk_agent/local/mysql(135): ss_get_mysql_stats()
#3 {main}
thrown in /usr/lib/check_mk_agent/local/mysql on line 1307
MariaDB version #1
librenms@NMS60:/opt/librenms-agent$ sudo mysql
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 27971
Server version: 10.5.17-MariaDB-1:10.5.17+maria~ubu2004 mariadb.org binary distribution
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)]>
MariaDB version #2
librenms@NMS60:/opt/librenms-agent$ sudo mysql
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 6156
Server version: 10.6.10-MariaDB-1:10.6.10+maria~ubu2004 mariadb.org binary distribution
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)]>
PHP version
librenms@NMS60:/opt/librenms-agent$ php -verstion
PHP 8.1.12 (cli) (built: Oct 28 2022 17:39:37) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.12, Copyright (c) Zend Technologies
with Zend OPcache v8.1.12, Copyright (c), by Zend Technologies
librenms-agent version
librenms@NMS60:/opt/librenms-agent$ git log
commit 0f0a31fa417ff3ed9137893d9c61c520bf9ad539 (HEAD -> master, origin/master, origin/HEAD)
Author: bnerickson <bnerickson87@gmail.com>
Date: Tue Nov 1 14:50:18 2022 -0700
Cleaning up pwrstatd code (#431)
commit 10bae306f306921a188d64c14988d3b876f0b76d
Author: Oskar Szafraniec <oskar.szafraniec@webdev.pl>
Date: Wed Oct 26 15:13:20 2022 +0200
run_query PHP 8.1 hot fix (#430)
As of PHP 8.1.0, the default setting is MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT. Previously, it was MYSQLI_REPORT_OFF.