cacti can't connect to mysql (checked everything)
Moderators: Developers, Moderators
cacti can't connect to mysql (checked everything)
The problem is that the log file says:
12/27/2005 11:45:07 PM - CMDPHP: Poller[0] ERROR: Cannot connect to MySQL server on 'localhost'. Please make sure you have specified a valid MySQL database name in 'include/config.php'.
This is what I did:
installed cacti with yast:
cp -rp /usr/share/cacti /srv/www/htdocs/cacti
php.ini
register_globals = On
register_argc_argv = On
config:
$database_type = "mysql";
$database_default = "cacti";
$database_hostname = "127.0.0.1";
$database_username = "root";
$database_password = "";
MYSQL:
mysql -u root
create database cacti
exit
mysql -u root cacti < /usr/share/cacti/cacti.sql
mysql -u root
use cacti
GRANT ALL PRIVILEGES ON cacti.* TO 'root'@'localhost' IDENTIFIED BY '';
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED BY '';
SHOW TABLES gives content.....
flush privileges;
I tried everything; $database_hostname = "localhost"; doesn't help either.
Very annoying; i do something wrong.... but what..
12/27/2005 11:45:07 PM - CMDPHP: Poller[0] ERROR: Cannot connect to MySQL server on 'localhost'. Please make sure you have specified a valid MySQL database name in 'include/config.php'.
This is what I did:
installed cacti with yast:
cp -rp /usr/share/cacti /srv/www/htdocs/cacti
php.ini
register_globals = On
register_argc_argv = On
config:
$database_type = "mysql";
$database_default = "cacti";
$database_hostname = "127.0.0.1";
$database_username = "root";
$database_password = "";
MYSQL:
mysql -u root
create database cacti
exit
mysql -u root cacti < /usr/share/cacti/cacti.sql
mysql -u root
use cacti
GRANT ALL PRIVILEGES ON cacti.* TO 'root'@'localhost' IDENTIFIED BY '';
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED BY '';
SHOW TABLES gives content.....
flush privileges;
I tried everything; $database_hostname = "localhost"; doesn't help either.
Very annoying; i do something wrong.... but what..
Last edited by blacksun on Tue Dec 27, 2005 6:15 pm, edited 1 time in total.
- rony
- Developer/Forum Admin
- Posts: 6022
- Joined: Mon Nov 17, 2003 6:35 pm
- Location: Michigan, USA
- Contact:
Does the web interface work?
[size=117][i][b]Tony Roman[/b][/i][/size]
[size=84][i]Experience is what causes a person to make new mistakes instead of old ones.[/i][/size]
[size=84][i]There are only 3 way to complete a project: Good, Fast or Cheap, pick two.[/i][/size]
[size=84][i]With age comes wisdom, what you choose to do with it determines whether or not you are wise.[/i][/size]
[size=84][i]Experience is what causes a person to make new mistakes instead of old ones.[/i][/size]
[size=84][i]There are only 3 way to complete a project: Good, Fast or Cheap, pick two.[/i][/size]
[size=84][i]With age comes wisdom, what you choose to do with it determines whether or not you are wise.[/i][/size]
yes.
I'm following this http://www.cacti.net/downloads/docs/htm ... graph.html
tutorial to test.
I've installed rddtool and all other software.
I'm following this http://www.cacti.net/downloads/docs/htm ... graph.html
tutorial to test.
I've installed rddtool and all other software.
Last edited by blacksun on Thu Dec 29, 2005 12:31 pm, edited 1 time in total.
- rony
- Developer/Forum Admin
- Posts: 6022
- Joined: Mon Nov 17, 2003 6:35 pm
- Location: Michigan, USA
- Contact:
What OS?
Are you running mysql in a chroot?
Is networking enabled for the mysql server?
Are you running mysql in a chroot?
Is networking enabled for the mysql server?
[size=117][i][b]Tony Roman[/b][/i][/size]
[size=84][i]Experience is what causes a person to make new mistakes instead of old ones.[/i][/size]
[size=84][i]There are only 3 way to complete a project: Good, Fast or Cheap, pick two.[/i][/size]
[size=84][i]With age comes wisdom, what you choose to do with it determines whether or not you are wise.[/i][/size]
[size=84][i]Experience is what causes a person to make new mistakes instead of old ones.[/i][/size]
[size=84][i]There are only 3 way to complete a project: Good, Fast or Cheap, pick two.[/i][/size]
[size=84][i]With age comes wisdom, what you choose to do with it determines whether or not you are wise.[/i][/size]
peter@peter:~> cat /etc/hosts
127.0.0.1 localhost
# special IPv6 addresses
::1 localhost ipv6-localhost ipv6-loopback
fe00::0 ipv6-localnet
ff00::0 ipv6-mcastprefix
ff02::1 ipv6-allnodes
ff02::2 ipv6-allrouters
ff02::3 ipv6-allhosts
192.168.1.5 peter.x.nl peter
ls -al /srv/www/htdocs/cacti/poller.php
-rw-r--r-- 1 root root 9247 2005-09-09 20:54 /srv/www/htdocs/cacti/poller.php
ls -al /usr/share/cacti/poller.php
-rw-r--r-- 1 root root 9247 2005-09-09 20:54 /usr/share/cacti/poller.php
vim /etc/sysconfig/apache2
APACHE_MODULES="access actions alias auth autoindex cgi dir include log_config mime negotiation setenvif status userdir asis
imap php4 auth_mysql"
crontab -e as root:
*/5 * * * * root php /srv/www/htdocs/cacti/poller.php > /dev/null 2>&1
If i run as root php /srv/www/htdocs/cacti/poller.php it generates graphs..
127.0.0.1 localhost
# special IPv6 addresses
::1 localhost ipv6-localhost ipv6-loopback
fe00::0 ipv6-localnet
ff00::0 ipv6-mcastprefix
ff02::1 ipv6-allnodes
ff02::2 ipv6-allrouters
ff02::3 ipv6-allhosts
192.168.1.5 peter.x.nl peter
ls -al /srv/www/htdocs/cacti/poller.php
-rw-r--r-- 1 root root 9247 2005-09-09 20:54 /srv/www/htdocs/cacti/poller.php
ls -al /usr/share/cacti/poller.php
-rw-r--r-- 1 root root 9247 2005-09-09 20:54 /usr/share/cacti/poller.php
vim /etc/sysconfig/apache2
APACHE_MODULES="access actions alias auth autoindex cgi dir include log_config mime negotiation setenvif status userdir asis
imap php4 auth_mysql"
crontab -e as root:
*/5 * * * * root php /srv/www/htdocs/cacti/poller.php > /dev/null 2>&1
If i run as root php /srv/www/htdocs/cacti/poller.php it generates graphs..
suggestions?
I've written a small php file which connects to the mysql database
and does a query.
it succeeds.
so it has something to do with the config.
/* make sure these values refect your actual database/host/user/password */
$database_type = "mysql";
$database_default = "cacti";
$database_hostname = "localhost";
$database_username = "root";
$database_password = "";
I've written a small php file which connects to the mysql database
and does a query.
it succeeds.
so it has something to do with the config.
/* make sure these values refect your actual database/host/user/password */
$database_type = "mysql";
$database_default = "cacti";
$database_hostname = "localhost";
$database_username = "root";
$database_password = "";
Who is online
Users browsing this forum: No registered users and 0 guests