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?
"Error connecting to database" after changing CCM settings
-
cwscribner
- Posts: 316
- Joined: Thu Mar 31, 2011 9:54 am
- Location: Patten, ME
- Contact:
"Error connecting to database" after changing CCM settings
Last edited by cwscribner on Mon Sep 19, 2011 2:15 pm, edited 1 time in total.
Re: "Error connecting to database" after changing CCM settin
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.
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.
Nicholas Scott
Former Nagios employee
Former Nagios employee
-
cwscribner
- Posts: 316
- Joined: Thu Mar 31, 2011 9:54 am
- Location: Patten, ME
- Contact:
Re: "Error connecting to database" after changing CCM settin
Both of those successfully connect.
Re: "Error connecting to database" after changing CCM settin
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.
/var/www/html/nagiosql/config/settings.php
Update the credentials and address in this file and see if it connects.
-
cwscribner
- Posts: 316
- Joined: Thu Mar 31, 2011 9:54 am
- Location: Patten, ME
- Contact:
Re: "Error connecting to database" after changing CCM settin
That fixed it. Thanks!