[HOWTO] Upgrade cacti installation from MySQL 4.1 to 5.0

If you figure out how to do something interesting/cool in Cacti and want to share it with the community, please post your experience here.

Moderators: Developers, Moderators

Post Reply
Chris W
Posts: 23
Joined: Fri Jun 16, 2006 2:05 pm

[HOWTO] Upgrade cacti installation from MySQL 4.1 to 5.0

Post by Chris W »

I had a lot of trouble with permissions going from MySQL 4.1 to 5.0. I thought I'd be okay by just using mysqldump on the mysql and cacti databases from MySQL 4.1 and importing them to 5.0, but as soon as I'd try and load cacti I'd get this error message:
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.
I think MySQL 5.0 handles users quite a bit differently than it does in MySQL 4.1. But anyway, here is what you need to correctly set permissions in MySQL 5.0 so that cacti works:

Code: Select all

grant CREATE,INSERT,SELECT,DELETE,UPDATE on cacti.* to cactiuser@localhost;
Query OK, 0 rows affected (0.00 sec)

mysql> grant CREATE,INSERT,SELECT,DELETE,UPDATE on cacti.* to cactiuser;
Query OK, 0 rows affected (0.00 sec)

mysql> SET PASSWORD FOR cactiuser@localhost = old_password('supersecretpassword');
Query OK, 0 rows affected (0.01 sec)

mysql> flush privileges;
Query OK, 0 rows affected, 1 warning (0.00 sec)
After that, you should be good to go! This is with MySQL-5.0.27 and cacti-0.8.6j. As you can see, my cacti user's name is cactiuser, and the cacti user's password is supersecretpassword.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest