MySQL IP限制筆記

資料來源:http://giovenni.blogspot.tw/2010/12/mysql-ip.html

// 顯示資料庫
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;

 

 

 

 

 

 

 

 

 

 

相關文章