mysql之限定特定IP訪問

2021-09-24 13:29:04 字數 506 閱讀 7093

由於最近自己在雲伺服器上搭載的mysql資料庫遭到黑客攻擊,導致資料丟失。兩次!!!第一次只是換個複雜的密碼,恢復資料耗費了我大量的時間,又給我攻擊了。所以決定限定ip訪問。

1、檢視mysql資料庫中所有使用者

mysql> select distinct concat('user: ''',user,'''@''',host,''';') as query from mysql.user;

如果有:

user: 'root'@'%';  表示所有ip都可以用root賬號訪問,需要把它刪掉

2、刪除賬戶及許可權:>drop user 使用者名稱@'%';

3、賦予許可權:

grant all privileges on *.* to 'root'@'訪問ip' identified by '資料庫密碼';

mysql允許遠端特定ip訪問

1.登入 mysql u root p之後輸入密碼登入 2.許可權設定 新增遠端ip訪問許可權 grant all privileges on to root 172.23.101.131 identified by lxw 123 with grant option flush privilege...

mysql登入IP限定

use myslq select from usre update user set host 192.where user root and host localhost update user set host 192.where user root and host localhost 重新整...

ORACLE 限制特定IP訪問資料庫

1 在9i中真正起作用的是sqlnet.ora檔案,我們修改sqlnet.ora其實是最好最快的方法。在sqlnet.ora中增加如下部分 來自 protocol.ora 的屬性 tcp.validnode checking yes 允許訪問的ip tcp.invited nodes ip1,ip2...