当前位置:Gxlcms > 数据库问题 > Mysql限制IP访问

Mysql限制IP访问

时间:2021-07-01 10:21:17 帮助过:50人阅读


show databases;

// 選擇 mysql db
use mysql;

// 顯示 user 權限
show grants for username;

// 開啟mysql db 連線的ip
grant all on dbname.* to ‘username’@‘localhost’ identified by ‘password’;
grant all on dbname.*  to ‘username’@‘ip’ identified by ‘password’;

// 顯示目前帳戶@ip 資訊
show grants for username@ip;

// 更新權限
flush privileges;


Mysql限制IP访问

标签:

人气教程排行