Mysql用户授权

经常遇到的关于Mysql授权的问题,这里仅仅做下简单记录:
GRANT Syntax:

 GRANT
priv_type [(column_list)]
  [, priv_type [(column_list)]] ...
ON [object_type] priv_level
TO user_or_role [, user_or_role] ...
[WITH GRANT OPTION]

GRANT PROXY ON user_or_role

TO user_or_role [, user_or_role] ...
[WITH GRANT OPTION]

GRANT role [, role] ...

TO user_or_role [, user_or_role] ...
[WITH ADMIN OPTION]

object_type: {

TABLE

| FUNCTION
| PROCEDURE
}

priv_level: {

*

| .
| db_name.*
| db_name.tbl_name
| tbl_name
| db_name.routine_name
}

user_or_role: {

user

| role
}

user:

(see Section 6.2.4, “Specifying Account Names”)

role:

(see Section 6.2.5, “Specifying Role Names”)

授权Mysql能被所有IP地址访问:

    
    GRANT ALL ON *.* TO 'root'@'%' IDENTIFIED  by 'password';
    flush privileges

Lokie博客
请先登录后发表评论
  • 最新评论
  • 总共0条评论
  • 本博客使用免费开源的 laravel-bjyblog v5.5.1.1 搭建 © 2014-2018 lokie.wang 版权所有 ICP证:沪ICP备18016993号
  • 联系邮箱:kitche1985@hotmail.com