cacti Error

FATAL: Cannot connect to MySQL server on ‘localhost’. Please make sure you have specified a valid MySQL database name in ‘include/config.php’

MySQL time zone ERROE

# rm -f /etc/localtime

# ln -s /usr/share/zoneinfo/UTC /etc/localtime

[root@nom-cs2 ~]# date

Tue Feb 28 13:37:53 UTC 2017 

#  vi /etc/php.ini

[Date]

; Defines the default timezone used by the date functions

; http://php.net/date.timezone

date.timezone = Asia/Dhaka

2.      Second check error in apache logs:

Change permission to 644 of db.php file in “/etc/cacti” folder.

# chmod 644 /etc/cacti/db.php

OR

# chmod 644 /var/www/html/cacti           [,tar install ]

root-bash> mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root -p mysql

# mysql -u root -p

mysql> use mysql;

mysql> GRANT SELECT ON mysql.time_zone_name TO cactiuser@localhost;

mysql> flush privileges;

# vi /etc/my.cnf        [and add bellow lines.]

[mysqld] 

default_time_zone=Asia/Dhaka

systemctl restart httpd.service

systemctl restart snmpd.service

systemctl restart mariadb.service