System Administration
cancel
Showing results for 
Search instead for 
Did you mean: 

Please make sure you have specified a valid MySQL database name in 'include/config.php'

 
NDO
Super Advisor

Please make sure you have specified a valid MySQL database name in 'include/config.php'

Hi all

I am trying to configure cacti on HP-UX 11.31, apache, mysql, php and cacti are already installed, but I am stuck with this error:
FATAL: Cannot connect to MySQL server on '10.100.48.13'. Please make sure you have specified a valid MySQL database name in 'include/config.php'

Please can I have your help?

F.R.
3 REPLIES
Matti_Kurkela
Honored Contributor

Re: Please make sure you have specified a valid MySQL database name in 'include/config.php'

- Is your MySQL server running on '10.100.48.13'?

- Does the MySQL database engine have a database prepared for Cacti?

The Cacti software package includes a file named "cacti.sql": that file contains the SQL commands that will create the correct database.

The command to do it is like this: "mysql cacti < cacti.sql". It should produce no error messages, only a listing of how many database items the command created/updated. If you see any error messages, the database creation was not successful: you must analyze the errors and fix them. If your organization has a dedicated DBA or someone with database administration experience, s/he might be able to help you, even if s/he normally uses some other database, like Oracle or DB2.

Note: you should realize that in the instructions in http://www.cacti.net/downloads/docs/html/unix_configure_cacti.html the SQL clause "GRANT ALL ON cacti.* TO cactiuser@localhost IDENTIFIED BY 'somepassword';" sets the cacti database password to "somepassword", but the next step tells you to configure the database password in include/config.php as
'$database_password = "cacti";'.

Of course, the database password given to Cacti must be the same as the database password configured to the MySQL database, otherwise it won't work.


- Can your Apache/PHP server (that's running Cacti) connect to MySQL port on '10.100.48.13', or is there a firewall or some other restriction stopping it? (You aren't even telling if Cacti and MySQL are on the same host or not!)

MK
MK
NDO
Super Advisor

Re: Please make sure you have specified a valid MySQL database name in 'include/config.php'

Hi

Yes I do have a database called cacti, I have setup my config.php as follows:
/* make sure these values refect your actual database/host/user/password */
$database_type = "mysql";
$database_default = "cacti";
$database_hostname = "10.100.48.13";
$database_username = "cacti";
$database_password = "cacti";
$database_port = "3306";

I have managed to connect to the DB:
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| cacti |
| test |
+--------------------+
3 rows in set (0.00 sec)

mysql>


F.R.
NDO
Super Advisor

Re: Please make sure you have specified a valid MySQL database name in 'include/config.php'

Hi

Please members of this forum, be nice to respond to this post





F.R.