Unable to connect to database

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
andrewatmacys
Posts: 114
Joined: Tue Feb 06, 2018 9:25 am

Unable to connect to database

Post by andrewatmacys »

I have a Nagios installation on version 5.4.13 and it's running a mariadb database, but I am unable to connect to it from outside the server. I have run the repair script and have looked at the config file in etc/my.cnf and found nothing indicating that it shouldn't be able to accept outside connections. It was working until recently as far as I am aware, so I'm not sure what happened to cause this shut out to happen. Is there any other place that I can look to see if it isn't accepting connections, or is there any way to check if it's just broken? The repair completed successfully so I don't think it's broken, and the firewall rules shouldn't have changed from what they were so I don't think that's it. Any help is appreciated! Thanks!
andrewatmacys
Posts: 114
Joined: Tue Feb 06, 2018 9:25 am

Re: Unable to connect to database

Post by andrewatmacys »

This is the error we are getting when attempting to connect.
You do not have the required permissions to view the files attached to this post.
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: Unable to connect to database

Post by npolovenko »

@andrewatmacys, On the MySQL server open the /etc/my.cnf file and add the following lines to the [mysqld] section.
bind-address=<IP address of this computer, the computer with MySQL or MariaDB>
port=3306
In this case, I used port 3306, most common one.
Then restart mariadb with:
service mariadb restart
On the mysql server sign in to the database and run this command:
GRANT ALL ON *.* TO root@'<ip_of_the_windows_server>' IDENTIFIED BY '<mysql_root_password>';
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
andrewatmacys
Posts: 114
Joined: Tue Feb 06, 2018 9:25 am

Re: Unable to connect to database

Post by andrewatmacys »

I'll update as soon as I can get root permission to modify that file.
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: Unable to connect to database

Post by npolovenko »

@andrewatmacys, Sounds good.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
andrewatmacys
Posts: 114
Joined: Tue Feb 06, 2018 9:25 am

Re: Unable to connect to database

Post by andrewatmacys »

Unfortunately we are still running into the same issue after adding the lines above. Just to make sure, the IP to be added is the one for the server that the DB is on, which is the Nagios server, correct?
andrewatmacys
Posts: 114
Joined: Tue Feb 06, 2018 9:25 am

Re: Unable to connect to database

Post by andrewatmacys »

Looking at a separate instance of Nagios that we're running the config file in question does not have the above entries, if that helps.

I can send both if needed.
andrewatmacys
Posts: 114
Joined: Tue Feb 06, 2018 9:25 am

Re: Unable to connect to database

Post by andrewatmacys »

I have created a support ticket at the request of my team, #661010. thanks!
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: Unable to connect to database

Post by npolovenko »

@andrewatmacys, Please sign in to the mysql server on the XI server:
mysql -u root -pnagiosxi
And then run this query:
GRANT ALL ON *.* TO 'root'@'ma000xbsql58a.federated.fds' IDENTIFIED BY 'nagiosxi';
This should fix your issue.
If your nagios XI root DB password is not 'nagiosxi' you need to change it in the command -> IDENTIFIED BY 'nagiosxi'.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
andrewatmacys
Posts: 114
Joined: Tue Feb 06, 2018 9:25 am

Re: Unable to connect to database

Post by andrewatmacys »

That worked, thank you! We can close the thread.
Locked