Mysql中对数据库进行用户管理

Mysql中对数据库进行用户管理
-- 创建用户,密码 可以在任意主机访问
CREATE user 'herma' @'%' IDENTIFIED by '123456'
-- 修改用户密码
ALTER user 'herma'@'%' IDENTIFIED with mysql_native_password by '1234';

SHOW GRANTS FOR'herma' @'%';
-- 将用户授予所有数据库权限
GRANT all on itcast.* to 'herma'@'%'
-- 撤销权限
REVOKE all on itcast.* from 'herma'@'%'
 
posted @ 2024-01-31 15:36  爱豆技术部  阅读(4)  评论(0编辑  收藏  举报
TOP