MySQL.授权管理

查看权限:show grants for '用户’@‘IP地址’

  授权:grant 权限on 数据库.表to ‘用户’@‘IP地址’

取消权限:revoke 权限 on 数据库.表 from ‘用户’@‘IP地址’

常用权限:all privileges 除grant外的所有权限

     select   仅查权限

     select,insert  查和插入权限

     usage  无法访问权限

对目标数据库以及内部其他:

    数据库名.*      #数据库中的所有

    数据库名.表     #指定数据库中的某张表

    数据库名.存储过程  #指定数据库中的数据过程

    *.*         #所有数据库

对于用户和IP:

用户名@IP地址      #用户只有在改IP下才能访问

用户名@192.168.1.%   #用户只有在改IP段下才能访问(通配符%表示任意)

用户名@%        #用户可以在任意IP下访问(默认IP地址为%)

all privileges 除grant外的所有权限

alter              #使用alter table

alter routine          #使用alter procedure 和drop procedure

create            #使用create table

create routine         #使用create procedure

create temporary tables    #使用create temporary tables

create user          #使用create user、drop user、rename user和revoke all privileges

create view          #使用create view

delete            #使用delete

drop              #使用drop table

execute            #使用call和储存过程

file              #使用selecet into outfile 和 load date infile

grant option          #使用grant和revoke

index             #使用index

insert              #使用insert

lock tables            #使用lock table

process            #使用show full processlist

select             #使用select

show tablebases       #使用show tablebases

show view           #使用show view

update            #使用update

reload            #使用flush

shutdown          #使用MySQLadmin shutdown(关闭MySQL)

super            #使用change master、kill、logs、purge、master、和set global  还允许MySQL试条登陆

replication  client       #服务器位置的访问

replication slave       #有复制从属使用

授权局域网内主机远程连接数据库:

百分号匹配法

子网掩码配置法

刷新权限

远程登录连接

原文地址:https://www.cnblogs.com/jacky912/p/10310139.html