MySQL管理

匿名 (未验证) 提交于 2019-12-02 22:06:11

mysql 对应版本8.0.11,某些语法不太一样。

1.用户管理

1 创建用户 2     create user 用户名@IP地址 identified by 密码; 3 删除用户 4     drop user 用户名@IP地址; 5 修改用户 6     rename user 用户名@IP地址 to 新用户名@IP地址; 7 修改密码 8     set password for 用户名@IP地址 = 新密码;

客户端登入命令

mysql -u 用户名 -h 192.168.1.1 -P 3306 -p u = user
h = host
P = port p
= password

2.权限管理

(1)基本命令

1 show grants for 用户@IP地址                  -- 查看权限 2 grant  权限 on 数据库.表 to   用户@IP地址      -- 授权 3 revoke 权限 on 数据库.表 from 用户@IP地址      -- 撤回

       *.* 所有的数据库.表                 %可以替代任意IP地址:“192.168.1.%”

(2)权限表

 1             all privileges  grant外的所有权限  2             select          仅查权限  3             select,insert   查和插入权限  4             ...  5             usage                   无访问权限  6             alter                   使用alter table  7             alter routine           使用alter proceduredrop procedure  8             create                  使用create table  9             create routine          使用create procedure 10             create temporary tables 使用create temporary tables 11             create user             使用create userdrop userrename userrevoke  all privileges 12             create view             使用create view 13             delete                  使用delete 14             drop                    使用drop table 15             execute                 使用call和存储过程 16             file                    使用select into outfile  load data infile 17             grant option            使用grant  revoke 18             index                   使用index 19             insert                  使用insert 20             lock tables             使用lock table 21             process                 使用show full processlist 22             select                  使用select 23             show databases          使用show databases 24             show view               使用show view 25             update                  使用update 26             reload                  使用flush 27             shutdown                使用mysqladmin shutdown(关闭MySQL) 28             super                   ????使用change masterkilllogspurgemasterset global。还允许mysqladmin????????调试登陆 29             replication client      服务器位置的访问 30             replication slave       由复制从属使用    
View Code

 

原文:https://www.cnblogs.com/Jimmy-Chen/p/9240589.html

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!