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

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

Moderators: Developers, Moderators

Post Reply
cacti-newbie
Posts: 4
Joined: Tue Jan 20, 2009 6:32 am
Location: Bénin
Contact:

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

Post by cacti-newbie »

Hi
i just intall cacti in my ispconfig web server. but i can't connect to my cacti page i have this error
FATAL: Cannot connect to MySQL server on 'localhost'. Please make sure you have specified a valid MySQL database name in 'include/config.php'
this is my config.php

Code: Select all

<?php
/*
 +-------------------------------------------------------------------------+
 | Copyright (C) 2004-2008 The Cacti Group                                 |
 |                                                                         |
 | This program is free software; you can redistribute it and/or           |
 | modify it under the terms of the GNU General Public License             |
 | as published by the Free Software Foundation; either version 2          |
 | of the License, or (at your option) any later version.                  |
 |                                                                         |
 | This program is distributed in the hope that it will be useful,         |
 | but WITHOUT ANY WARRANTY; without even the implied warranty of          |
 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the           |
 | GNU General Public License for more details.                            |
 +-------------------------------------------------------------------------+
 | Cacti: The Complete RRDTool-based Graphing Solution                     |
 +-------------------------------------------------------------------------+
 | This code is designed, written, and maintained by the Cacti Group. See  |
 | about.php and/or the AUTHORS file for specific developer information.   |
 +-------------------------------------------------------------------------+
 | http://www.cacti.net/                                                   |
 +-------------------------------------------------------------------------+
*/

/* make sure these values refect your actual database/host/user/password */
$database_type = "mysql";
$database_default = "cacti";
$database_hostname = "localhost";
$database_username = "cactiuser";
$database_password = "moov";
$database_port = "3306";

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

?>
my database with cacti is web1db1.
mysql user is root
and password moov
how can i resolve my probleme?
User avatar
browniebraun
Developer
Posts: 791
Joined: Tue Jun 13, 2006 1:17 am
Location: Cologne, Germany

Post by browniebraun »

You forgot to change variable $database_default to "web1db1".

Best regards
-Andreas-
Hat das Blümchen einen Knick, war der Schmetterling zu dick! ;)
reportit v0.7.5a
SNMPAgent v0.2.3
Download ReportIt | Download SNMPAgent | ReportIt SVN | ReportIt Templates | Wish list
cacti-newbie
Posts: 4
Joined: Tue Jan 20, 2009 6:32 am
Location: Bénin
Contact:

Post by cacti-newbie »

thanks for your help but i have the same error
this my new config.php

Code: Select all

/* make sure these values refect your actual database/host/user/password */
$database_type = "mysql";
$database_default = "web1db1";
$database_hostname = "localhost";
$database_username = "cactiuser";
$database_password = "moov";
$database_port = "3306";
daksh
Cacti User
Posts: 78
Joined: Tue Nov 11, 2008 4:46 pm

Post by daksh »

cacti-newbie wrote: my database with cacti is web1db1.
mysql user is root
and password moov
how can i resolve my probleme?
You mention "moov" is root user's password, but what is the password for cactiuser? You need to put password for cactiuser in config.php

Can you connect from command line?

Code: Select all

mysql -ucactiuser -p<cacti_user_password> web1db1
[/code]
cacti-newbie
Posts: 4
Joined: Tue Jan 20, 2009 6:32 am
Location: Bénin
Contact:

Post by cacti-newbie »

thank you the probleme is resolve i forget to change the user of the database
sachinnair
Posts: 1
Joined: Mon May 06, 2013 1:39 am

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

Post by sachinnair »

i have done these things..but still am getting the same error when i tried http://localhost/cacti.

i have installed cacti-0.8.8a-el5...
pls give me any solution..
joachim5
Cacti User
Posts: 53
Joined: Sun Feb 10, 2013 7:29 am

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

Post by joachim5 »

sachinnair wrote:i have done these things..but still am getting the same error when i tried http://localhost/cacti.

i have installed cacti-0.8.8a-el5...
pls give me any solution..
follow this installation guide:

http://myconfigure.blogspot.co.at/2013/ ... -1210.html
Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests