Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to know about MySQL 'refused connections'

I am using MONyog to montitor my two mysql servers. I get alert emails from MONyog when something goes wrong. There is an error I could not find out why. It says:

Connection History: Percentage of refused connections) - 66.67%

the percentage is not important, this is just about having refused connections. I get this email every half an hour. So this is like a constant situation. This must be my mistake, because I just set up those servers and there is no chance somebody else could be interfering the servers.

MONyog advices me:

  1. Try to isolate users/applications that are using an incorrect password or trying to connect from unauthorized hosts.
  2. A client will be disallowed to connect if it takes more than connect_timeout seconds to connect.
  3. Set the value of log_warnings system variable to 2. This will force the MySQL server to log further information about the error.

I added log_warnings=2 to my.cnf and I enabled logging like this:

[mysqld_safe]
.
.
log_warnings=2
log-error = /var/log/mysql/error.log
.
.
.
.
[mysqld_safe]
.
log-error=/var/log/mysqld.log
.
.

I cannot see any warnings at /var/log/mysql/error.log I can see some warnings at /var/log/mysqld.log but they are about something else.

In sum, my question is how can I detect refused connections? Please let me know if any more info is required.

Thanks in advance.

like image 923
pars Avatar asked Apr 28 '10 11:04

pars


People also ask

How do I fix MySQL connection refused?

Check that the DB username, DB password, database host, and database port are correct. (if you are unsure, reach out to your database administrator or check in your web hosting account for the up to date credentials). If the config file references host = "localhost" , you can try to change it to 127.0.

Can't connect to database connection refused?

A Connection Refused (IP Address) error occurs when: You use the wrong IP address in the connection string. Use the database's private IP address in the connection string and try to connect from a Droplet that isn't allowed to access the VPC network.


1 Answers

Solved

log_warnings=2

should have been

log-warnings=2

like image 102
pars Avatar answered Oct 16 '22 10:10

pars