Cacti Installation Problems

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

Moderators: Developers, Moderators

Post Reply
jamie
Posts: 11
Joined: Mon Dec 05, 2005 9:04 am

Cacti Installation Problems

Post by jamie »

Ok here is what is happening I did the installation of the cacti 0.8.6h
and fully patched it.

I go to http://www.myservername.com/cacti

(I replace of course the myservername.com with my actual site name)
and I get the following error.

Error

You have created a new database, but have not yet imported the 'cacti.sql' file. At the command line, execute the following to continue:


mysql -u cactiuser -p cacti < cacti.sql

This error may also be generated if the cacti database user does not have correct permissions on the cacti database. Please ensure that the cacti database user has the ability to SELECT, INSERT, DELETE, UPDATE, CREATE, ALTER, DROP, INDEX on the cacti database.


So I go try and import the database even though I already know I have done that and then I get this error because the table already exists.

mysql -u cactiuser -p cacti < cacti.sql
Enter password:
ERROR 1050 (42S01) at line 5: Table 'cdef' already exists

I also tried the following line as well to grant the database all
privilages.

mysql --user=root -p cacti
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 5 to server version: 4.1.18-standard-log

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql>

GRANT ALL on cacti.* TO cactiuser@localhost IDENTIFIED BY 'cacti' WITH GRANT OPTION;

Still didn't work and I still get the same error as before.

A bit of information about the machine.

Cacti 0.8.6h (Fully patched)
PHP Version 4.4.1
MySql Version 4.1.18 (standard)
Apache 2.2.0
Linux Version Slackware 10.2

Any ideas as to what may be going on and why I am getting these
problems.

Any help that you can give would be greatly appreciated.

Thanks,

Jamie
User avatar
rony
Developer/Forum Admin
Posts: 6022
Joined: Mon Nov 17, 2003 6:35 pm
Location: Michigan, USA
Contact:

Post by rony »

Drop and recreate the database and then try re-importing the cacti.sql.
[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]
jamie
Posts: 11
Joined: Mon Dec 05, 2005 9:04 am

Post by jamie »

rony wrote:Drop and recreate the database and then try re-importing the cacti.sql.
I tried that and I still get the same error.

Jamie
User avatar
N3NCY
Cacti User
Posts: 260
Joined: Thu Sep 22, 2005 7:50 pm
Location: Landenberg, PA
Contact:

Post by N3NCY »

Here are the steps I take in setting up MySQL:

# Install the base database
/opt/mysql/bin/mysql_install_db

# Add a “mysql” user to your system: (MySQL should not need to run as root!)
pw groupadd mysql
pw useradd mysql -g mysql
passwd mysql

# Set directory permissions to correct owner based on where you installed MySQL, example:
chown -R mysql:mysql /opt/mysql/

# Start the server
/opt/mysql/bin/mysqld_safe &

# Perform Basic Checks
/opt/mysql/bin/mysqladmin version
/opt/mysql/bin/mysqladmin variables

# Set a Password!
/opt/mysql/bin/mysqladmin -u root password SomePassword

# Add a "database" user with password and grant that user permission to connect
/opt/mysql/bin/mysql --user=root --password mysql
SomePassword

GRANT ALL PRIVILEGES ON *.* TO mysql@localhost IDENTIFIED BY 'SomePassword' WITH GRANT OPTION;
GRANT ALL PRIVILEGES ON *.* TO mysql@"%" IDENTIFIED BY 'SomePassword' WITH GRANT OPTION;
FLUSH PRIVILEGES;
exit


Then as part of my Cacti install:
# Create the MySQL database:
/opt/mysql/bin/mysqladmin --user=root -p create cacti

# Import the default cacti database:
/opt/mysql/bin/mysql --user=root -p cacti < /opt/apache/htdocs/cacti/cacti.sql

# Create a MySQL username and password for Cacti
/opt/mysql/bin/mysql --user=root -p mysql
GRANT ALL ON cacti.* TO cacti@localhost IDENTIFIED BY 'cactipassword';
flush privileges;
exit

# Edit include/config.php and specify the MySQL user, password and database for your Cacti configuration
vi /opt/apache/htdocs/cacti/include/config.php
$database_default = "cacti";
$database_hostname = "localhost";
$database_username = "cacti";
$database_password = "cactipassword";


One of my last steps is making sure the web server user can read all the Cacti files:
# Update directory permissions
chown -R nobody:nobody /opt/apache/htdocs/cacti/


Looking at the steps I take, do you deviate in some way?

My complete step by step instructions are in my signature...
Thank you,

Ernie
http://www.NMSWorld.com
[b]Dual Zeon Dual Core 2.6Ghz / 8GB RAM / 4x15k RPM SATA RAID5[/b]
[b]Cacti Version[/b] - 0.8.7b
[b]Poller Type[/b] - cactid 0.8.7 with Boost v1.7
[b]Server Info[/b] - FreeBSD 7.0-RELEASE
[b]Web Server[/b] - Apache/2.2.6 (Unix) mod_ssl/2.2.6 OpenSSL/0.9.8g DAV/2 PHP/5.2.5 mod_perl/2.0.3 Perl/v5.8.8
[b]PHP[/b] - 5.2.6
[b]MySQL[/b] - 5.0.51b Mod: poller_output ENGINE = MEMORY
[b]RRDTool[/b] - 1.3.0
[b]SNMP[/b] - 5.4.1
[b]Plugins[/b] - Host Info (hostinfo - v0.2), Update Checker (update - v0.3), Network Tools (tools - v0.2), FlowView (flowview - v0.3), Read-only Devices Tab (devices - v0.4), Network Discovery (discovery - v0.8.3), Syslog Monitoring (syslog - v0.5.2), Thresholds (thold - v0.3.9), Device Monitoring (monitor - v0.8.2), PHP Network Weathermap (weathermap - v0.941), SuperLinks (superlinks - v0.72), Report Creator (reports - v0.1b)
jamie
Posts: 11
Joined: Mon Dec 05, 2005 9:04 am

Cacti Issues

Post by jamie »

N3NCY wrote:Here are the steps I take in setting up MySQL:


Looking at the steps I take, do you deviate in some way?

My complete step by step instructions are in my signature...
Listen I followed the install instructions exactly as they were listed to install Cacti. I never had this problem installing cacti before on machines.

I have the mysql group and user setup and everything is setup
correctly that way.

I am getting an error though in my cacti error_log file


[11-Mar-2006 18:20:09] PHP Warning: mysql_pconnect(): Client does not support authentication protocol requested by server; consider upgrading MySQL client in
/home/webmaster/web-root/cacti/lib/adodb/drivers/adodb-mysql.inc.php on line 356
[11-Mar-2006 18:20:10] PHP Warning: mysql_pconnect(): Client does not support authentication protocol requested by server; consider upgrading MySQL client in
/home/webmaster/web-root/cacti/lib/adodb/drivers/adodb-mysql.inc.php on line 356

Any ideas on why I may be getting that?

I still have the same problem and it still isn't fixed. Any help is greatly appreciated.

Jamie
User avatar
N3NCY
Cacti User
Posts: 260
Joined: Thu Sep 22, 2005 7:50 pm
Location: Landenberg, PA
Contact:

Post by N3NCY »

The only two thoughts that I have are as follows:

1.) Try adding this to your /etc/my.cnf file
old_passwords

2.) Use MySQL Administrator to connect to your database and change the root’s password to something other than none (not using a blank password I assume)

I see other people (not Cacti users) reporting the same error message as you with other software packages.
PHP Warning: mysql_pconnect(): Client does not support authentication protocol
Setting a password or "re-setting" the password is a fix in some cases.

I am sorry I am not more help, the only thing I can say is here is the exact install I do keystroke for keystroke:
http://members.netjunkies.net/n3ncy/FreeBSD60/

I feel your frustration, I am tempted to pull down a copy of Slackware and run through it! I was a Slackware junkie before I switched to FreeBSD. I am still fond of my days with Slackware!

On another thought, wouldn't it be something if it turned out to be a PHP and ADODB issue? Hmmm.

Hopefully someone will jump on this thread that has already worked through this.

You know there is one more thing I do that I don't see other people listing.
In my crontab I set some variables:

# Edit /etc/crontab
vi /etc/crontab
SHELL=/bin/sh
PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/lib
HOME=/var/log
LD_LIBRARY_PATH=/usr/local/lib:/opt/net-snmp/lib/:/opt/mysql/lib/mysql/

Notice that I do add the mysql libs to my LD_LIBRARY_PATH
You would need to set the paths to your locations of course.

Just a thought.
Thank you,

Ernie
http://www.NMSWorld.com
[b]Dual Zeon Dual Core 2.6Ghz / 8GB RAM / 4x15k RPM SATA RAID5[/b]
[b]Cacti Version[/b] - 0.8.7b
[b]Poller Type[/b] - cactid 0.8.7 with Boost v1.7
[b]Server Info[/b] - FreeBSD 7.0-RELEASE
[b]Web Server[/b] - Apache/2.2.6 (Unix) mod_ssl/2.2.6 OpenSSL/0.9.8g DAV/2 PHP/5.2.5 mod_perl/2.0.3 Perl/v5.8.8
[b]PHP[/b] - 5.2.6
[b]MySQL[/b] - 5.0.51b Mod: poller_output ENGINE = MEMORY
[b]RRDTool[/b] - 1.3.0
[b]SNMP[/b] - 5.4.1
[b]Plugins[/b] - Host Info (hostinfo - v0.2), Update Checker (update - v0.3), Network Tools (tools - v0.2), FlowView (flowview - v0.3), Read-only Devices Tab (devices - v0.4), Network Discovery (discovery - v0.8.3), Syslog Monitoring (syslog - v0.5.2), Thresholds (thold - v0.3.9), Device Monitoring (monitor - v0.8.2), PHP Network Weathermap (weathermap - v0.941), SuperLinks (superlinks - v0.72), Report Creator (reports - v0.1b)
jamie
Posts: 11
Joined: Mon Dec 05, 2005 9:04 am

Post by jamie »

N3NCY wrote:The only two thoughts that I have are as follows:

1.) Try adding this to your /etc/my.cnf file
old_passwords

2.) Use MySQL Administrator to connect to your database and change the root’s password to something other than none (not using a blank password I assume)

I see other people (not Cacti users) reporting the same error message as you with other software packages.
PHP Warning: mysql_pconnect(): Client does not support authentication protocol
Setting a password or "re-setting" the password is a fix in some cases.

I am sorry I am not more help, the only thing I can say is here is the exact install I do keystroke for keystroke:
http://members.netjunkies.net/n3ncy/FreeBSD60/

I feel your frustration, I am tempted to pull down a copy of Slackware and run through it! I was a Slackware junkie before I switched to FreeBSD. I am still fond of my days with Slackware!

On another thought, wouldn't it be something if it turned out to be a PHP and ADODB issue? Hmmm.

Hopefully someone will jump on this thread that has already worked through this.

You know there is one more thing I do that I don't see other people listing.
In my crontab I set some variables:

# Edit /etc/crontab
vi /etc/crontab
SHELL=/bin/sh
PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/lib
HOME=/var/log
LD_LIBRARY_PATH=/usr/local/lib:/opt/net-snmp/lib/:/opt/mysql/lib/mysql/

Notice that I do add the mysql libs to my LD_LIBRARY_PATH
You would need to set the paths to your locations of course.

Just a thought.
I added that link to my my.cnf file

I also walked though an set of how tos at
which was of great help.

http://www.hostlibrary.com/installing_a ... p_on_linux

I had it working and Cacti was working then I stopped my SQL and restarted it and now I am getting this error.


Warning: mysql_pconnect(): Lost connection to MySQL server during query in /home/webmaster/web-root/cacti/lib/adodb/drivers/adodb-mysql.inc.php on line 355

Warning: mysql_pconnect(): Lost connection to MySQL server during query in /home/webmaster/web-root/cacti/lib/adodb/drivers/adodb-mysql.inc.php on line 355

Warning: mysql_pconnect(): Lost connection to MySQL server during query in /home/webmaster/web-root/cacti/lib/adodb/drivers/adodb-mysql.inc.php on line 355

Warning: Cannot modify header information - headers already sent by (output started at /home/webmaster/web-root/cacti/lib/adodb/drivers/adodb-mysql.inc.php:355) in /home/webmaster/web-root/cacti/include/auth.php on line 31


Any ideas how to get cacti going again and why this happened after it was working. All I did was stop mysql and restart it and then I am getting this error now.

Thanks,

Jamie
jamie
Posts: 11
Joined: Mon Dec 05, 2005 9:04 am

Post by jamie »

jamie wrote:
Any ideas how to get cacti going again and why this happened after it was working. All I did was stop mysql and restart it and then I am getting this error now.

Thanks,

Jamie
I got it working again. Cacti is up and working again.

Thanks for everyones help.

Jamie
beculetZ
Posts: 2
Joined: Mon Apr 17, 2006 3:29 pm

Post by beculetZ »

hello guys!

When I try to install cacti i get the following error:

Error

You have created a new database, but have not yet imported the 'cacti.sql' file. At the command line, execute the following to continue:

mysql -u cacti -p cacti < cacti.sql

This error may also be generated if the cacti database user does not have correct permissions on the cacti database. Please ensure that the cacti database user has the ability to SELECT, INSERT, DELETE, UPDATE, CREATE, ALTER, DROP, INDEX on the cacti database.

Yes, i did do all the stuff needed, also the config.php

What i want to tell, is that all my php based application gave errors of mysql because it does not have the mysql.sock file in /tmp, but in /var/lib/mysql/mysql.sock

so i set it to localhost:/var/lib/mysql/mysql.sock
and then, for eg, e107 works, or verliadmin!
only when I type that to db_host
but here it isn't woking :(
i saw a port in config.php
I think mysql server (mine) does not support remote connections.

Help please!!!!
vaporisatuer
Posts: 1
Joined: Mon Feb 20, 2006 2:08 am

Post by vaporisatuer »

Try doing

#mysql -u cacti -p cacti < cacti.sql

or

(Root)
#mysql cacti < cacti.sql
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests