Sorry for the delay. I had to recreate a new env in Dev to test this. Same issue.
/var/log/httpd/error_log is showing it is using the old data dir. See below.
profile.zip
/var/lib/mysql has been renamed to /var/lib/mysql.bak
my.cnf & my.cnf.d/client.cnf
Code: Select all
[nagios@myucburhel74 ~]$ cat /etc/my.cnf
[mysqld]
query_cache_size=16M
query_cache_limit=4M
tmp_table_size=64M
max_heap_table_size=64M
key_buffer_size=32M
table_open_cache=32
innodb_file_per_table=1
datadir=/nagiosdb/mysql
socket=/nagiosdb/mysql/mysql.sock
#datadir=/var/lib/mysql
#socket=/var/lib/mysql/mysql.sock
[client]
port=3306
socket=/nagiosdb/mysql/mysql.sock
# Disabling symbolic-links is recommended to prevent assorted security risks
#symbolic-links=0
# Settings user and group are ignored when systemd is used.
# If you need to run mysqld under a different user or group,
# customize your systemd unit file for mariadb according to the
# instructions in http://fedoraproject.org/wiki/Systemd
[mysqld_safe]
log-error=/var/log/mariadb/mariadb.log
pid-file=/var/run/mariadb/mariadb.pid
#
# include all files from the config directory
#
!includedir /etc/my.cnf.d
[nagios@myucburhel74 ~]$ cat /etc/my.cnf.d/client.cnf
#
# These two groups are read by the client library
# Use it for options that affect all clients, but not the server
#
[client]
socket=/nagiosdb/mysql/mysql.sock
# This group is not read by mysql client library,
# If you use the same .cnf file for MySQL and MariaDB,
# use it for MariaDB-only client options
[client-mariadb]
[nagios@myucburhel74 ~]$
The SQL test requested. It works fine
Code: Select all
mysql -h 127.0.0.1 -unagiosql -p'n@gweb' nagiosql -e "select * from tbl_host limit 1;"
+----+-----------+-----------+--------------+-----------+---------+--------------------+------------+-----------------------+---------------+--------------+-------------------------+---------------+--------------------+----------------+----------------+-----------------------+------------------------+--------------+------------------+-----------------+---------------------+---------------+-----------------------+--------------------+---------------------+------------------------+------------------------+-------------------+---------------------------+------------------------------+----------+---------------------+----------------+---------------------------+-----------------------+---------------------+--------------------------+----------------------+-----------------------+------------------+-------+-----------+------------+------------+----------------+------------+-----------------+-----------+-----------+---------------+------+--------+---------------------+---------------+-----------+
| id | host_name | alias | display_name | address | parents | parents_tploptions | hostgroups | hostgroups_tploptions | check_command | use_template | use_template_tploptions | initial_state | max_check_attempts | check_interval | retry_interval | active_checks_enabled | passive_checks_enabled | check_period | obsess_over_host | check_freshness | freshness_threshold | event_handler | event_handler_enabled | low_flap_threshold | high_flap_threshold | flap_detection_enabled | flap_detection_options | process_perf_data | retain_status_information | retain_nonstatus_information | contacts | contacts_tploptions | contact_groups | contact_groups_tploptions | notification_interval | notification_period | first_notification_delay | notification_options | notifications_enabled | stalking_options | notes | notes_url | action_url | icon_image | icon_image_alt | vrml_image | statusmap_image | 2d_coords | 3d_coords | use_variables | name | active | last_modified | access_rights | config_id |
+----+-----------+-----------+--------------+-----------+---------+--------------------+------------+-----------------------+---------------+--------------+-------------------------+---------------+--------------------+----------------+----------------+-----------------------+------------------------+--------------+------------------+-----------------+---------------------+---------------+-----------------------+--------------------+---------------------+------------------------+------------------------+-------------------+---------------------------+------------------------------+----------+---------------------+----------------+---------------------------+-----------------------+---------------------+--------------------------+----------------------+-----------------------+------------------+-------+-----------+------------+------------+----------------+------------+-----------------+-----------+-----------+---------------+------+--------+---------------------+---------------+-----------+
| 1 | localhost | localhost | | 127.0.0.1 | 0 | 2 | 0 | 2 | NULL | 1 | 2 | | NULL | NULL | NULL | 2 | 2 | 0 | 2 | 2 | NULL | 0 | 2 | NULL | NULL | 2 | | 2 | 2 | 2 | 0 | 2 | 0 | 2 | NULL | 0 | NULL | | 2 | | | | | | | | | | | 0 | | 1 | 2020-04-17 20:07:33 | NULL | 1 |
+----+-----------+-----------+--------------+-----------+---------+--------------------+------------+-----------------------+---------------+--------------+-------------------------+---------------+--------------------+----------------+----------------+-----------------------+------------------------+--------------+------------------+-----------------+---------------------+---------------+-----------------------+--------------------+---------------------+------------------------+------------------------+-------------------+---------------------------+------------------------------+----------+---------------------+----------------+---------------------------+-----------------------+---------------------+--------------------------+----------------------+-----------------------+------------------+-------+-----------+------------+------------+----------------+------------+-----------------+-----------+-----------+---------------+------+--------+---------------------+---------------+-----------+
[nagios@myucburhel74 my.cnf.d]$
Datadir listing
Code: Select all
[nagios@myucburhel74 ~]$ ls -la /nagiosdb/mysql
total 28744
drwxr-xr-x 8 mysql mysql 4096 Nov 18 18:26 .
drwxr-xr-x 3 root root 4096 Nov 18 17:54 ..
-rw-rw---- 1 mysql mysql 16384 Nov 18 18:08 aria_log.00000001
-rw-rw---- 1 mysql mysql 52 Nov 18 18:08 aria_log_control
-rw-rw---- 1 mysql mysql 18874368 Nov 18 18:42 ibdata1
-rw-rw---- 1 mysql mysql 5242880 Nov 18 18:42 ib_logfile0
-rw-rw---- 1 mysql mysql 5242880 Nov 18 18:30 ib_logfile1
drwx------ 2 mysql mysql 4096 Apr 17 2020 mysql
srwxrwxrwx 1 mysql mysql 0 Nov 18 18:26 mysql.sock
drwx------ 2 mysql mysql 12288 Nov 18 18:30 nagios
drwx------ 2 mysql mysql 16384 Nov 18 18:30 nagiosql
drwx------ 2 mysql mysql 4096 Nov 18 18:30 nagiosxi
drwx------ 2 mysql mysql 4096 Apr 17 2020 performance_schema
drwx------ 2 mysql mysql 4096 Apr 17 2020 test
Code: Select all
[nagios@myucburhel74 my.cnf.d]$ mysql -unagiosql -pn@gweb -e 'select count(*) from information_schema.tables'
+----------+
| count(*) |
+----------+
| 157 |
+----------+
[nagios@myucburhel74 my.cnf.d]$
This works in all my other instances but not in the moved data dir
[nagios@myucburhel74 ~]$ mysql --user=root --password=nagiosxi --host=localhost
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
tail -Fn0 /var/log/httpd/error_log /var/log/httpd/ssl_error_log
Code: Select all
[nagios@myucburhel74 ~]$ tail -Fn0 /var/log/httpd/error_log /var/log/httpd/ssl_error_log
==> /var/log/httpd/error_log <==
==> /var/log/httpd/ssl_error_log <==
==> /var/log/httpd/error_log <==
[Wed Nov 18 18:40:12.399219 2020] [:error] [pid 9039] [client 10.17.44.253:51046] PHP Warning: mysqli::mysqli(): (HY000/2002): Can't connect to local MySQL server through socket '[b]/var/lib/mysql/mysql.sock[/b]' (2) in /usr/local/nagiosxi/html/includes/components/ccm/classes/db.class.php on line 82, referer: http://10.104.28.124/nagiosxi/includes/components/ccm/xi-index.php
[Wed Nov 18 18:40:12.399295 2020] [:error] [pid 9039] [client 10.17.44.253:51046] PHP Warning: mysqli::set_charset(): Couldn't fetch mysqli in /usr/local/nagiosxi/html/includes/components/ccm/classes/db.class.php on line 86, referer: http://10.104.28.124/nagiosxi/includes/components/ccm/xi-index.php
[Wed Nov 18 18:40:12.406213 2020] [:error] [pid 9039] [client 10.17.44.253:51046] PHP Warning: mysqli::query(): Couldn't fetch mysqli in /usr/local/nagiosxi/html/includes/components/ccm/classes/db.class.php on line 87, referer: http://10.104.28.124/nagiosxi/includes/components/ccm/xi-index.php
[Wed Nov 18 18:40:12.406256 2020] [:error] [pid 9039] [client 10.17.44.253:51046] PHP Warning: mysqli::real_escape_string(): Couldn't fetch mysqli in /usr/local/nagiosxi/html/includes/components/ccm/classes/db.class.php on line 362, referer: http://10.104.28.124/nagiosxi/includes/components/ccm/xi-index.php
[Wed Nov 18 18:40:12.406282 2020] [:error] [pid 9039] [client 10.17.44.253:51046] PHP Warning: mysqli::real_escape_string(): Couldn't fetch mysqli in /usr/local/nagiosxi/html/includes/components/ccm/classes/db.class.php on line 362, referer: http://10.104.28.124/nagiosxi/includes/components/ccm/xi-index.php
[Wed Nov 18 18:40:12.406299 2020] [:error] [pid 9039] [client 10.17.44.253:51046] PHP Warning: mysqli::real_escape_string(): Couldn't fetch mysqli in /usr/local/nagiosxi/html/includes/components/ccm/classes/db.class.php on line 362, referer: http://10.104.28.124/nagiosxi/includes/components/ccm/xi-index.php
[Wed Nov 18 18:40:12.406319 2020] [:error] [pid 9039] [client 10.17.44.253:51046] PHP Warning: mysqli::real_escape_string(): Couldn't fetch mysqli in /usr/local/nagiosxi/html/includes/components/ccm/classes/db.class.php on line 362, referer: http://10.104.28.124/nagiosxi/includes/components/ccm/xi-index.php
[Wed Nov 18 18:40:12.407635 2020] [:error] [pid 9039] [client 10.17.44.253:51046] PHP Warning: mysqli::real_escape_string(): Couldn't fetch mysqli in /usr/local/nagiosxi/html/includes/components/ccm/classes/db.class.php on line 362, referer: http://10.104.28.124/nagiosxi/includes/components/ccm/xi-index.php
[Wed Nov 18 18:40:12.407671 2020] [:error] [pid 9039] [client 10.17.44.253:51046] PHP Warning: mysqli::real_escape_string(): Couldn't fetch mysqli in /usr/local/nagiosxi/html/includes/components/ccm/classes/db.class.php on line 362, referer: http://10.104.28.124/nagiosxi/includes/components/ccm/xi-index.php
[Wed Nov 18 18:40:12.408540 2020] [:error] [pid 9039] [client 10.17.44.253:51046] PHP Warning: mysqli::query(): Couldn't fetch mysqli in /usr/local/nagiosxi/html/includes/components/ccm/classes/db.class.php on line 103, referer: http://10.104.28.124/nagiosxi/includes/components/ccm/xi-index.php
[Wed Nov 18 18:40:12.408569 2020] [:error] [pid 9039] [client 10.17.44.253:51046] PHP Warning: DB::query(): Property access is not allowed yet in /usr/local/nagiosxi/html/includes/components/ccm/classes/db.class.php on line 105, referer: http://10.104.28.124/nagiosxi/includes/components/ccm/xi-index.php
[Wed Nov 18 18:40:12.408579 2020] [:error] [pid 9039] [client 10.17.44.253:51046] PHP Notice: Trying to get property of non-object in /usr/local/nagiosxi/html/includes/components/ccm/classes/db.class.php on line 116, referer: http://10.104.28.124/nagiosxi/includes/components/ccm/xi-index.php
[Wed Nov 18 18:40:12.408586 2020] [:error] [pid 9039] [client 10.17.44.253:51046] PHP Fatal error: Call to a member function free() on a non-object in /usr/local/nagiosxi/html/includes/components/ccm/classes/db.class.php on line 121, referer: http://10.104.28.124/nagiosxi/includes/components/ccm/xi-index.php
Please advice how to fix this issue. Only CCM is blank.