Page 1 of 1
"Error connecting to database" after changing CCM settings
Posted: Mon Sep 19, 2011 11:38 am
by cwscribner
Hi all.
I recently attempted to offload MySQL to a separate server. I changed the IP address in the Config Manager Settings to the server holding the new MySQL database and now get an "Error connecting to database" message in the CCM. How can I fix this?
Re: "Error connecting to database" after changing CCM settin
Posted: Mon Sep 19, 2011 12:10 pm
by nscott
The biggest cause of this is:
Bad password / Firewall settings
Can you drop down the terminal and try some stuff out:
In these examples I'm going to use the variables REMOTEIP will be the IP of the MySQL server you offloaded to, PASSWORD, USERNAME are the password and username for the REMOTE MySQL server, and NAGIOS is the name of the NAGIOS database and NAGIOSQL is the name of the nagiosql database
mysql -u USERNAME -p PASSWORD -h REMOTEIP
Does this connect?
mysql -u USERNAME -pPASSWORD -h REMOTEIP NAGIOS
mysql -u USERNAME -pPASSWORD -h REMOTEIP NAGIOSQL
Does these connect?
If none of those connect look at the firewall/authentication.
Re: "Error connecting to database" after changing CCM settin
Posted: Mon Sep 19, 2011 12:54 pm
by cwscribner
Both of those successfully connect.
Re: "Error connecting to database" after changing CCM settin
Posted: Mon Sep 19, 2011 1:22 pm
by mguthrie
The DB settings for the CCM may be trying to connect with the settings located in the following file:
/var/www/html/nagiosql/config/settings.php
Update the credentials and address in this file and see if it connects.
Re: "Error connecting to database" after changing CCM settin
Posted: Mon Sep 19, 2011 2:15 pm
by cwscribner
That fixed it. Thanks!
Re: "Error connecting to database" after changing CCM settin
Posted: Mon Sep 19, 2011 5:03 pm
by mguthrie
Good deal!