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

数据库远程连接权限配置

时间:2015-10-06 22:04:00      阅读:194      评论:0      收藏:0      [点我收藏+]

标签:

登录mysql

GRANT ALL PRIVILEGES ON *.* TO ‘username‘@‘IP‘ IDENTIFIED BY ‘password‘;

这里的IP填写能访问数据库的ip地址, 如果需要所有地址都能访问,则填%

GRANT ALL ON db.* TO username@192.168.12.10  IDENTIFIED BY "123456";
GRANT ALL ON db.table TO username@192.168.12.% IDENTIFIED BY "123456";
GRANT ALL ON db.* TO username@192.168.12.0/24  IDENTIFIED BY "123456";
GRANT ALL ON *.* TO username@% IDENTIFIED BY "123456";

然后刷新权限

FLUSH PRIVILEGES;

附创建用户

CREATE USER ‘myuser‘@‘localhost‘ IDENTIFIED BY ‘mypass‘;
CREATE USER ‘myuser‘@‘%‘ IDENTIFIED BY ‘mypass‘;

  

数据库远程连接权限配置

标签:

原文地址:http://www.cnblogs.com/chemandy/p/4857734.html

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