#test表示你要建立的用户名,后面的123表示密码 #用户可以在任何地方登陆 mysql> create user test identified by‘123‘; #限制在固定地址登陆 mysql> create user test@localhost identified by ‘123‘;
#格式:grant select on 数据库.* to 用户名@登录主机 identified by "密码" mysql> grant all on *.* to user@localhost mysql> grant select,insert,update,delete on *.* to test@"%" identified by "123"; mysql> flush privileges;
原文地址:http://my.oschina.net/mosen/blog/292492