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;

 

 

 

 

 

 

 

 

 

 

相关文章