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

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

Post Reply
bolds
Posts: 12
Joined: Fri Aug 18, 2006 12:48 pm
Contact:

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

Post by bolds »

NEWBIE ---

Hi group, I am having a hard time getting my install of cacti to work. I went through the documentation and did everything it said to do. My issue is when I open a browser to try to get to the front page I get the following error message

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

I have my /include/config.php set correctly - or atleast I set it to how I installed cacti.

I am going to paste my config.php file in here are well.
***************************************************
<?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 = "cacti";
$database_password = "*14msgwan!!";
$database_port = "3306";

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

?>
~

Can someone help the new guy learn. If there are some special commands you want me to execute so you can get a better feel of what I have installed just let me know.

i386 PC
Kubuntu 8.04
Firefox 3.0

I do have smokeping running and it works just fine.....

Please any help would be greatly appreciated. Thanks Brandon
Ateo
Posts: 26
Joined: Fri Sep 26, 2008 1:07 pm
Location: http://reno.nevada.u$

Post by Ateo »

Is MySQL running? Post output of:

Code: Select all

ps aux |grep mysql
bolds
Posts: 12
Joined: Fri Aug 18, 2006 12:48 pm
Contact:

mysql is running

Post by bolds »

Yes mysql is running...

root@bolds-linux:~# ps aux |grep mysql
root 10740 0.0 0.1 3004 768 pts/1 S+ 14:38 0:00 grep mysql

I would really like to get this up and running by the weekend. I have Apache2 running. I know, cause I can edit the /var/www/index.html file and it opens. I even added a folder called bolds, and copied a pic to it. I can open it up via 10.60.100.15/bolds/....

http://10.60.100.15/
opens my page....

My ultimate goal is to get Cacti up and running with Weathermap pluggin

folder structure is as follows
/var/www/cacti-0.8.7b
/etc/apache2/
/etc/php5/
Ateo
Posts: 26
Joined: Fri Sep 26, 2008 1:07 pm
Location: http://reno.nevada.u$

Q

Post by Ateo »

bolds wrote:Yes mysql is running...
No. It's not.

The output you want is something like:

Code: Select all

boron scripts # ps aux |grep mysql
mysql    18303  0.0  1.5 142140 31540 ?        Ssl  Sep24  11:02 /usr/sbin/mysqld --defaults-file=/etc/mysql/my.cnf --basedir=/usr --datadir=/var/lib/mysql --pid-file=/var/run/mysqld/mysqld.pid --socket=/var/run/mysqld/mysqld.sock
Start MySQL with:

Code: Select all

sudo /etc/init.d/mysql start
.. then try again.

If you get access errors, such as:

Code: Select all

Access denied for user 'cacti'@'localhost' (using password: YES)
...configure MySQL so cacti can access. That's all in the docs.
bolds
Posts: 12
Joined: Fri Aug 18, 2006 12:48 pm
Contact:

Post by bolds »

It failed.... hmmm

now what?

root@bolds-linux:/usr/src# /etc/init.d/mysql start
* Starting MySQL database server mysqld
...fail!
root@bolds-linux:/usr/src#
Ateo
Posts: 26
Joined: Fri Sep 26, 2008 1:07 pm
Location: http://reno.nevada.u$

Post by Ateo »

Post output of:

Code: Select all

tail -n 50 /var/log/mysql.err
and

Code: Select all

tail -n 50 /var/log/mysql.log
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests