FATAL: Cannot connect to MySQL server on 'localhost'...

Post support questions that directly relate to Linux/Unix operating systems.

Moderators: Developers, Moderators

Post Reply
swiftguy121
Posts: 1
Joined: Fri Jul 17, 2009 11:12 am

FATAL: Cannot connect to MySQL server on 'localhost'...

Post by swiftguy121 »

Hello All,

Trying to install cacti on fedora 10. I installed the cacti using 'yum install cacti'.

It did install cacti but i could not see cacti in the default document root folder (i.e var/www/html)

Again I downloaded 'cacti-0.8e.tar.gz' and installed in /var/www/html

executed the following set of commands from console


Configure MySQL
groupadd cacti
useradd -g cacti cactyuser
mysql
mysql> set password for root@localhost=password('password');
mysql> create database cactidb;
mysql> grant all on cactidb.* to root;
mysql> grant all on cactidb.* to root@localhost;
mysql> grant all on cactidb.* to cactyuser;
mysql> grant all on cactidb.* to cactyuser@localhost;
mysql> set password for cactyuser@localhost=password('password');
mysql> exit

• mysql --user=root -p cactidb < cacti.sql
• chown -R cactyuser rra/ log/


I also changed the DB config details in global.php and config.php to the following

$database_type = "mysql";
$database_default = "cactidb";
$database_hostname = "localhost";
$database_username = "cactyuser";
$database_password = "cactyuser321";
$database_port = "3306";

/* Default session name - Session name must contain alpha characters */
$cacti_session_name = "Cacti";




Inspite doing all this i still get "FATAL: Cannot connect to MySQL server on 'localhost'. Please make sure you have specified a valid MySQL database name in 'include/config.php'"


Kindly help me out.
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

Either restart mysqld, or run "flush privileges" from the mysql command prompt. I think your problem is that the grant commands haven't taken effect yet.
Weathermap 0.98a is out! & QuickTree 1.0. Superlinks is over there now (and built-in to Cacti 1.x).
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests