从以前的网络主机中删除/删除mysql'user'@'host'剩余是否安全?

时间:2016-02-02 07:20:00

标签: mysql duplicates

我有以下MySQL用户和主机 远离root,用户'usern'是我的cPanel帐户用户名,用户(leechprotect,modsec,roundcube,cphulkd,eximstats)与cPanel相关(那些没有问题,因为它们只连接到'localhost')。
其他7个帐户连接到多个mysql HOST 。 7个mysql用户(usern_an,usern_anup,usern_mup,usern_up,usern_upp,usern_vb,usern_vb3,usern_vbtu)中的每一个都连接到数据库。

mysql> SELECT User, Host FROM mysql.user;                                       
+----------------+------------------------------+  
| User           | Host                         |  
+----------------+------------------------------+  
| usern         | ip1.ip1.ip1.ip1                 |  
| usern_an      | ip1.ip1.ip1.ip1                 |  
| usern_anup    | ip1.ip1.ip1.ip1                 |  
| usern_mup     | ip1.ip1.ip1.ip1                 |   
| usern_up      | ip1.ip1.ip1.ip1                 |  
| usern_upp     | ip1.ip1.ip1.ip1                 |  
| usern_vb      | ip1.ip1.ip1.ip1                 |  
| usern_vb3     | ip1.ip1.ip1.ip1                 |  
| usern_vbtu    | ip1.ip1.ip1.ip1                 |  
| root          | 127.0.0.1                    |  
| usern         | ip2.ip2.ip2.ip2                |  
| usern_an      | ip2.ip2.ip2.ip2                |  
| usern_anup    | ip2.ip2.ip2.ip2                |   
| usern_mup     | ip2.ip2.ip2.ip2                |  
| usern_up      | ip2.ip2.ip2.ip2                |  
| usern_upp     | ip2.ip2.ip2.ip2                |  
| usern_vb      | ip2.ip2.ip2.ip2                |  
| usern_vb3     | ip2.ip2.ip2.ip2                |  
| usern_vbtu    | ip2.ip2.ip2.ip2                |  
| usern         | ip3.ip3.ip3.ip3                |  
| usern_an      | ip3.ip3.ip3.ip3                |  
| usern_anup    | ip3.ip3.ip3.ip3                |  
| usern_mup     | ip3.ip3.ip3.ip3                |  
| usern_up      | ip3.ip3.ip3.ip3                |  
| usern_upp     | ip3.ip3.ip3.ip3                |   
| usern_vb      | ip3.ip3.ip3.ip3                |  
| usern_vb3     | ip3.ip3.ip3.ip3                |  
| usern_vbtu    | ip3.ip3.ip3.ip3                |  
| usern         | ip4.ip4.ip4.ip4               |  
| usern_an      | ip4.ip4.ip4.ip4               |  
| usern_anup    | ip4.ip4.ip4.ip4               |  
| usern_mup     | ip4.ip4.ip4.ip4               |  
| usern_up      | ip4.ip4.ip4.ip4               |  
| usern_upp     | ip4.ip4.ip4.ip4               |  
| usern_vb      | ip4.ip4.ip4.ip4               |  
| usern_vb3     | ip4.ip4.ip4.ip4               |  
| usern_vbtu    | ip4.ip4.ip4.ip4               |  
| usern         | ip5.ip5.ip5.ip5                |  
| usern_an      | ip5.ip5.ip5.ip5                |  
| usern_anup    | ip5.ip5.ip5.ip5                |  
| usern_mup     | ip5.ip5.ip5.ip5                |  
| usern_up      | ip5.ip5.ip5.ip5                |  
| usern_upp     | ip5.ip5.ip5.ip5                |  
| usern_vb      | ip5.ip5.ip5.ip5                |  
| usern_vb3     | ip5.ip5.ip5.ip5                |  
| usern_vbtu    | ip5.ip5.ip5.ip5                |  
| usern         | ip6.ip6.ip6.ip6                 |  
| usern_an      | ip6.ip6.ip6.ip6                 |  
| usern_anup    | ip6.ip6.ip6.ip6                 |  
| usern_mup     | ip6.ip6.ip6.ip6                 |  
| usern_up      | ip6.ip6.ip6.ip6                 |  
| usern_upp     | ip6.ip6.ip6.ip6                 |  
| usern_vb      | ip6.ip6.ip6.ip6                 |  
| usern_vb3     | ip6.ip6.ip6.ip6                 |  
| usern_vbtu    | ip6.ip6.ip6.ip6                 |  
| root          | ::1                          |  
| usern         | c1server.domserverC.com |  
| usern_an      | c1server.domserverC.com |  
| usern_anup    | c1server.domserverC.com |  
| usern_mup     | c1server.domserverC.com |  
| usern_up      | c1server.domserverC.com |  
| usern_upp     | c1server.domserverC.com |  
| usern_vb      | c1server.domserverC.com |  
| usern_vb3     | c1server.domserverC.com |  
| usern_vbtu    | c1server.domserverC.com |  
| usern         | gserver.domserverA.com  |  
| usern_an      | gserver.domserverA.com |  
| usern_anup    | gserver.domserverA.com |   
| usern_mup     | gserver.domserverA.com          |  
| usern_up      | gserver.domserverA.com          |  
| usern_upp     | gserver.domserverA.com          |  
| usern_vb      | gserver.domserverA.com          |  
| usern_vb3     | gserver.domserverA.com          |  
| usern_vbtu    | gserver.domserverA.com          |  
| usern         | iserver.domserverB.com          |  
| usern_an      | iserver.domserverB.com             |  
| usern_anup    | iserver.domserverB.com             |  
| usern_mup     | iserver.domserverB.com             |  
| usern_up      | iserver.domserverB.com             |  
| usern_upp     | iserver.domserverB.com             |  
| usern_vb      | iserver.domserverB.com             |  
| usern_vb3     | iserver.domserverB.com             |  
| usern_vbtu    | iserver.domserverB.com             |  
| cphulkd        | localhost                    |  
| eximstats      | localhost                    |  
| usern         | localhost                    |  
| usern_an      | localhost                    |  
| usern_anup    | localhost                    |  
| usern_mup     | localhost                    |  
| usern_up      | localhost                    |   
| usern_upp     | localhost                    |  
| usern_vb      | localhost                    |  
| usern_vb3     | localhost                    |  
| usern_vbtu    | localhost                    |  
| leechprotect   | localhost                    |  
| modsec         | localhost                    |  
| root           | localhost                    |  
| roundcube      | localhost                    |  
| usern         | mserver.domserverA.com          |  
| usern_vb      | mserver.domserverA.com          |  
| usern_vbtu    | mserver.domserverA.com          |  
| root           | mserver.domserverA.com          |  
| usern         | server.domserverA.net        |  
| usern_vb      | server.domserverA.net        |  
| usern_vbtu    | server.domserverA.net        |  
| usern         | server1.domserverD.com       |  
| usern_an   | server1.domserverD.com       |  
| usern_anup | server1.domserverD.com       |  
| usern_mup     | server1.domserverD.com       |  
| usern_up      | server1.domserverD.com       |  
| usern_upp     | server1.domserverD.com       |  
| usern_vb      | server1.domserverD.com       |  
| usern_vb3     | server1.domserverD.com       |  
+----------------+------------------------------+  
113 rows in set (0.00 sec) 

实际上,只有ip1.ip1.ip1.ip1是我当前使用当前网络主机的IP 远离'localhost'和'ip1。',其他的ips和服务器名称来自以前的web主机。

删除/删除那些“用户”@“主机”是否安全?

2 个答案:

答案 0 :(得分:0)

是的,它是安全的,并且在后端没有问题来访问db。

为方便起见,如果出现问题,您可以将root用户重新创建为here

示例:

mysql -u root
mysql> grant all privileges on *.* to 'root'@'localhost' with grant option;

答案 1 :(得分:0)

首先,找出运行

时未使用的帐户
SHOW FULL PROCESSLIST;

这可以让您了解当前会话以及用户。

确保用户调用此命令具有PROCESS权限或仅使用root帐户(如果您有权访问它)

参考here