码迷,mamicode.com
首页 > 数据库 > 详细

Mysql限制IP访问

时间:2015-08-03 17:06:52      阅读:635      评论:0      收藏:0      [点我收藏+]

标签:

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

标签:

原文地址:http://my.oschina.net/bobwei/blog/487114

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!