MySQL用户管理

说明

MySQL所有用户的信息都保存在 mysql.user 这个表中。

权限管理 https://www.cnblogs.com/mc-r/p/15968652.html

操作

用户管理

  1. 添加用户
create user ‘test'@'%' identified by '1234';

-- test: 用户名
-- %: 任意位置登陆
-- 1234: 密码
  1. 删除用户
drop user 'test'@'%';
  1. 修改用户信息
update user set password=password('123') where user='test' and host='localhost';
-- 如果版本高于 5.7.6 则使用 authentication_string 代替 Password 字段
update mysql.user set authentication_string=password('000000') where user = 'test';

权限管理

权限管理 https://www.cnblogs.com/mc-r/p/15968652.html

posted @ 2022-06-17 11:23  看不见的R  阅读(28)  评论(0编辑  收藏  举报