标签:
登录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