
БД для кактуса сделал, юзера с паролем и правами тоже, но вижу такое сообще в браузере
Что имеем:FATAL: Connection to Cacti database failed. Please ensure:
the PHP MySQL module is installed and enabled.
the database is running.
the credentials in config.php are valid.
Код: Выделить всё
# php --ini
Configuration File (php.ini) Path: /usr/local/etc
Loaded Configuration File: /usr/local/etc/php.ini
Scan for additional .ini files in: /usr/local/etc/php
Additional .ini files parsed: /usr/local/etc/php/ext-18-session.ini,
/usr/local/etc/php/ext-20-bz2.ini,
/usr/local/etc/php/ext-20-ctype.ini,
/usr/local/etc/php/ext-20-filter.ini,
/usr/local/etc/php/ext-20-gd.ini,
/usr/local/etc/php/ext-20-gettext.ini,
/usr/local/etc/php/ext-20-gmp.ini,
/usr/local/etc/php/ext-20-hash.ini,
/usr/local/etc/php/ext-20-json.ini,
/usr/local/etc/php/ext-20-ldap.ini,
/usr/local/etc/php/ext-20-mbstring.ini,
/usr/local/etc/php/ext-20-mysqli.ini,
/usr/local/etc/php/ext-20-openssl.ini,
/usr/local/etc/php/ext-20-pdo.ini,
/usr/local/etc/php/ext-20-posix.ini,
/usr/local/etc/php/ext-20-simplexml.ini,
/usr/local/etc/php/ext-20-snmp.ini,
/usr/local/etc/php/ext-20-sockets.ini,
/usr/local/etc/php/ext-20-xml.ini,
/usr/local/etc/php/ext-20-zip.ini,
/usr/local/etc/php/ext-20-zlib.ini,
/usr/local/etc/php/ext-30-pdo_mysql.ini
Код: Выделить всё
# php -v
PHP 7.2.14 (cli) (built: Jan 30 2019 12:19:04) ( ZTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
Код: Выделить всё
# php -m
[PHP Modules]
bz2
Core
ctype
date
filter
gd
gettext
gmp
hash
json
ldap
libxml
mbstring
mysqli
mysqlnd
openssl
pcre
PDO
pdo_mysql
posix
Reflection
session
SimpleXML
snmp
sockets
SPL
standard
xml
zip
zlib
[Zend Modules]
Код: Выделить всё
$database_type = 'mysql';
$database_default = 'cacti';
$database_hostname = 'localhost';
$database_username = 'cacti';
$database_password = 'cacti';
$database_port = '/tmp/mysql.sock';
$database_ssl = false;
$database_ssl_key = '';
$database_ssl_cert = '';
$database_ssl_ca = '';
Код: Выделить всё
# cat php.ini | grep mysql.default_socket
pdo_mysql.default_socket=
mysql.default_socket = /tmp/mysql.sock
Код: Выделить всё
# php /usr/local/share/cacti/poller.php
FATAL: Connection to Cacti database failed. Please ensure:
- the PHP MySQL module is installed and enabled.
- the database is running.
- the credentials in config.php are valid.
Код: Выделить всё
# sockstat | grep mysql
mysql mysqld 65019 67 stream /tmp/mysql.sock
mysql mysqld 65019 69 stream /tmp/mysqlx.sock
mysql mysqld 65019 70 stream /tmp/mysql.sock
www httpd 63700 9 stream -> /tmp/mysql.sock
Код: Выделить всё
# mysql -u cacti -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 73
Server version: 8.0.14 Source distribution
Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
cacti@localhost [(none)]> show databases;
+--------------------+
| Database |
+--------------------+
| cacti |
| information_schema |
| mysql |
+--------------------+
3 rows in set (0.00 sec)
cacti@localhost [(none)]> use cacti;
Database changed
cacti@localhost [cacti]> show tables;
+---------------------------------+
| Tables_in_cacti |
+---------------------------------+
| aggregate_graph_templates |
| aggregate_graph_templates_graph |
| aggregate_graph_templates_item |
| aggregate_graphs |
| aggregate_graphs_graph_item |
| aggregate_graphs_items |
| automation_devices |
| automation_graph_rule_items |
| automation_graph_rules |
| automation_ips |
| automation_match_rule_items |
| automation_networks |
| automation_processes |
| automation_snmp |
| automation_snmp_items |
| automation_templates |
| automation_tree_rule_items |
| automation_tree_rules |
| cdef |
| cdef_items |
+---------------------------------+
20 rows in set (0.00 sec)