关于MySQL的状态变量Aborted_clients & Aborted_connects别离代表的意义,以及哪些环境或因素会导致这些状态变量变革呢?下文通过尝试测试来验证一下,首先我们来看看状态变量的描写:
Aborted Connect
Aborted Connect暗示实验毗连到MySQL处事器失败的次数。这个状态变量可以团结host_cache表和其错误日志一起来阐明问题。 引起这个状态变量激增的原因如下:
官方表明如下:
If a client is unable even to connect, the server increments the Aborted_connects status variable. Unsuccessful connection attempts can occur for the following reasons:
Aborted Clients:
Aborted Clients暗示由于客户端没有正确封锁毗连而中止的毗连数。官方表明如下:
The number of connections that were aborted because the client died without closing the connection properly. See Section B.5.2.10, “Communication Errors and Aborted Connections”
当Aborted Clients增大的时候意味着有客户端乐成成立毗连,可是由于某些原因断开毗连可能被终止了,这种环境一般产生在网络不不变的情况中。主要的大概性有:
官方文档B.5.2.10 Communication Errors and Aborted Connections的先容如下:
If a client successfully connects but later disconnects improperly or is terminated, the server increments the Aborted_clients status variable, and logs an Aborted connection message to the error log. The cause can be any of the following:
Other reasons for problems with aborted connections or aborted clients:
如上先容所示,有许多因素引起这些状态变量的值变革,那么我们来一个个阐明、演示一下吧。首先,我们来测试一下导致Aborted Connect状态变量增加的大概因素
1、 客户端没有权限可是实验会见MySQL数据库。
其实这里所说的没有权限,小我私家领略是:客户端利用没有授权的账号会见数据库 。打个例如,你实验用账号kkk会见MySQL数据库,其实你也不知道数据库是否存在这个用户,劳务派遣管理系统,实际上不存在这个用户。
尝试比拟测试前,先将状态变量清零。
mysql> flush status; Query OK, 0 rows affected (0.01 sec) mysql> show status like 'Abort%'; +------------------+-------+ | Variable_name | Value | +------------------+-------+ | Aborted_clients | 0 | | Aborted_connects | 0 | +------------------+-------+ 2 rows in set (0.01 sec) mysql> mysql> select host,user from mysql.user; +-------------------------------+-----------+ | host | user | +-------------------------------+-----------+ | % | mydba | | % | root | | % | test | | 127.0.0.1 | root | | 192.168.% | mydbadmin | | 192.168.103.18,192.168.103,22 | LimitIP | | ::1 | root | | db-server.localdomain | root | | localhost | backuser | | localhost | root | +-------------------------------+-----------+