From b245b3b4a8946652d68e026616bfe029d091f761 Mon Sep 17 00:00:00 2001 From: Junichi Satoh Date: Fri, 20 Dec 2019 11:25:01 +0900 Subject: [PATCH] Added support for MySQL 8.0. --- pandora_console/include/functions_servers.php | 6 ++++-- pandora_console/install.php | 7 +++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/pandora_console/include/functions_servers.php b/pandora_console/include/functions_servers.php index 4049df62c9..a3649994fc 100644 --- a/pandora_console/include/functions_servers.php +++ b/pandora_console/include/functions_servers.php @@ -919,9 +919,10 @@ function servers_get_info($id_server=-1) // Remote servers LAG Calculation (server_type != 0). if ($server['server_type'] != 0) { + // MySQL 8.0 has function lag(). So, lag must be enclosed in quotations. $result = db_get_row_sql( 'SELECT COUNT(tagente_modulo.id_agente_modulo) AS module_lag, - AVG(UNIX_TIMESTAMP() - utimestamp - current_interval) AS lag + AVG(UNIX_TIMESTAMP() - utimestamp - current_interval) AS "lag" FROM tagente_estado, tagente_modulo, tagente WHERE utimestamp > 0 AND tagente.disabled = 0 @@ -935,9 +936,10 @@ function servers_get_info($id_server=-1) ); } else { // Local/Dataserver server LAG calculation. + // MySQL 8.0 has function lag(). So, lag must be enclosed in quotations. $result = db_get_row_sql( 'SELECT COUNT(tagente_modulo.id_agente_modulo) AS module_lag, - AVG(UNIX_TIMESTAMP() - utimestamp - current_interval) AS lag + AVG(UNIX_TIMESTAMP() - utimestamp - current_interval) AS "lag" FROM tagente_estado, tagente_modulo, tagente WHERE utimestamp > 0 AND tagente.disabled = 0 diff --git a/pandora_console/install.php b/pandora_console/install.php index 01dd3aba64..c891e8f385 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -965,9 +965,12 @@ function install_step4() $step5 = mysqli_query( $connection, - "GRANT ALL PRIVILEGES ON `$dbname`.* to pandora@$host - IDENTIFIED BY '".$random_password."'" + "CREATE USER pandora@$host IDENTIFIED BY '".$random_password."'" ); + $step5 |= mysqli_query( + $connection, + "GRANT ALL PRIVILEGES ON `$dbname`.* to pandora@$host" + ); mysqli_query($connection, 'FLUSH PRIVILEGES'); check_generic($step5, "Established privileges for user pandora. A new random password has been generated: $random_password
Please write it down, you will need to setup your Pandora FMS server, editing the /etc/pandora/pandora_server.conf file
");