Unable to connect to database
-
andrewatmacys
- Posts: 114
- Joined: Tue Feb 06, 2018 9:25 am
Unable to connect to database
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
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
@andrewatmacys, On the MySQL server open the /etc/my.cnf file and add the following lines to the [mysqld] section.
Then restart mariadb with:
In this case, I used port 3306, most common one.bind-address=<IP address of this computer, the computer with MySQL or MariaDB>
port=3306
Then restart mariadb with:
On the mysql server sign in to the database and run this command:service mariadb restart
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
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
@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
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
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.
I can send both if needed.
-
andrewatmacys
- Posts: 114
- Joined: Tue Feb 06, 2018 9:25 am
Re: Unable to connect to database
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
@andrewatmacys, Please sign in to the mysql server on the XI server:
If your nagios XI root DB password is not 'nagiosxi' you need to change it in the command -> IDENTIFIED BY 'nagiosxi'.
And then run this query:mysql -u root -pnagiosxi
This should fix your issue.GRANT ALL ON *.* TO 'root'@'ma000xbsql58a.federated.fds' IDENTIFIED BY 'nagiosxi';
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
That worked, thank you! We can close the thread.