您的位置:首页 > 数据库 > MySQL

MySql用户创建、授权以及删除

2013-09-21 17:42 417 查看
/article/3874246.html

The create user command:

<!---->mysql> CREATE USER yy IDENTIFIED BY '123';

yy表示你要建立的用户名,后面的123表示密码

上面建立的用户可以在任何地方登陆。

如果要限制在固定地址登陆,比如localhost 登陆:

<!---->mysql> CREATE USER yy@localhost IDENTIFIED BY '123';

grant:

<!---->mysql> GRANT ALL PRIVILEGES ON *.* TO user@localhost

<!---->grant select,insert,update,delete on *.* to test1@"%" Identified by "abc";

grant select,insert,update,delete on *.* to test1@"%" Identified by "abc";

格式:grant select on 数据库.* to 用户名@登录主机 identified by "密码"

修改密码:

<!---->mysql> grant all privileges on pureftpd.* to koko@localhost identified by 'mimi';

flush:

<!---->mysql> flush privileges;

查看用户信息:

<!---->mysql> select host,user from mysql.user;
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: