# Installing cacti mysql database >>>SOLVED<<<

## portcullischain

OK.....so I'm just a total noob that is having major frustration issues with getting Cacti to work with Gentoo.  I've been following the directions from http://gentoo-wiki.com/Cacti/Installation and I'm getting stuck with the directions for inserting the default database.  The command given is 

```
mysql -u cactiuser -p cacti < cacti.sql
```

.  Whenever I enter this command, I get an error 

```
bash: cacti.sql: No such file or directory
```

.  I'm not sure where I'm going wrong, but I'm starting to bald early from the sleepless nights.  Does anyone have any insight to this matter?

-PC

Cross-posted at:https://forums.gentoo.org/viewtopic-p-5091986.html#5091986Last edited by portcullischain on Thu May 15, 2008 4:53 pm; edited 1 time in total

----------

## kashani

does an ls show that cacti.sql actually exists? My guess is that you are in the wrong directory. Try specifying the full path the cacti.sql file. 

kashani

----------

## portcullischain

 *kashani wrote:*   

> does an ls show that cacti.sql actually exists? My guess is that you are in the wrong directory. Try specifying the full path the cacti.sql file. 
> 
> kashani

 

yea....that's what I thought too, but a 

```
find / -name 'cacti.sql'
```

 doesn't bring back any results.

-PC

----------

## xtz

What are the contents of cacti.sql? Try to instert them manually in MySQL.

----------

## kashani

 *portcullischain wrote:*   

> 
> 
> yea....that's what I thought too, but a 
> 
> ```
> ...

 

You should have mentioned that the file didn't exist, that makes me think it was never installed correctly. I'd  remove the install you created using webapp-config then remove and emerge cacti again.

In a fresh install of cacti which installed cacti-0.8.7b-r2 on my system I see a cacti.sql in /usr/share/webapps/cacti/0.8.7b-r2/htdocs/cacti.sql as well as in the directory into which I had installed cacti using webapp-config. Do you actually have the first location?

kashani

----------

## portcullischain

 *kashani wrote:*   

>  *portcullischain wrote:*   
> 
> yea....that's what I thought too, but a 
> 
> ```
> ...

 

sorry about that....my bad.  I removed my install and re-emerged cacti and got back to the 

```
mysql -u cactiuser -p cacti < cacti.sql
```

I must have done something different because now I'm getting an 

```
ERROR 1045 (28000): Access denied for user 'cactiuser'@'localhost' (using password: YES)
```

I can verify with a locate cacti.sql that the file now exists.  I'm using all the default username and passwords with the install.  Not sure where to go now.

-PC

----------

## kashani

Have you done the Mysql setup steps?

```

mysql -u root -p

mysql> create database cacti;

mysql> grant all on cacti.* to cactiuser@localhost;

mysql> set password for cactiuser@localhost=password('cactipass');

mysql> flush privileges;

mysql> exit

```

kashani

----------

## portcullischain

 *kashani wrote:*   

> Have you done the Mysql setup steps?
> 
> ```
> 
> mysql -u root -p
> ...

 

I had, but I must have done something wrong.  I removed the install, re-emerged it and lo and behold....there are post install instructions if you scroll up on the SSH window.  I followed those to the letter and my initial webpage is active.  Thanks for your help.  I'll probably be starting another post in a day or so when I get stuck again.  Thanks.

-PC

----------

