mysql允許遠端特定ip訪問

2021-10-17 03:43:14 字數 605 閱讀 4702

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 privileges;

172.23.101.131是允許遠端訪問的ip的值

mysql 8.0

create user 'test'@'172.23.101.131' identified with mysql_native_password by 'lxw@123';

grant all privileges on *.* to 'test'@'172.23.101.131';

flush privileges;

如果需要指定許可權,就將all改為select delete update insert等四種許可權任選即可

如果建立錯了,可以使用下面語句刪除使用者:

drop user '使用者名稱'@'ip';

mysql允許遠端IP訪問

預設情況下linux內的mysql資料庫mysql,user表內的使用者許可權只是對localhost即本機才能登陸。需要更改許可權 mysql grant all privileges on to root identified by password with grant option 表示是所...

MYSQL 允許遠端訪問

本文詳細介紹ubuntu下mysql資料庫安裝後初步設定。1 安裝mysql 這個應該很簡單了,而且我覺得大家在安裝方面也沒什麼太大問題,所以也就不多說了,下面我們來講講配置。2 配置mysql 注意,在ubuntu下mysql預設是只允許本地訪問的,如果你要其他機器也能夠訪問的話,那麼需要改變 e...

mysql允許外部IP訪問

預設情況下linux內的mysql資料庫mysql,user表內的使用者許可權只是對localhost即本機才能登陸。需要更改許可權 mysql grant all privileges on to root identified by password with grant option 表示是所...