一,新建用户
CREATE USER 'laoliu'@'127.0.0.1' IDENTIFIED BY 'laoliupassword';
二,修改用户密码
8.0.3及以后
SET PASSWORD FOR 'laoliu'@'127.0.0.1' = 'laoliupass1';
8.0.3之前
ALTER USER 'laoliu'@'127.0.0.1' IDENTIFIED BY 'laoliupass2';
三,修改用户名:
修改之前:
SELECT user,host from mysql.user;
修改用户名
RENAME USER 'laoliu'@'127.0.0.1' TO 'liulaoshi'@'127.0.0.1'
修改之后:
SELECT user,host from mysql.user;
四,删除用户
drop命令同时删除用户并清除其权限
DROP USER 'liulaoshi'@'127.0.0.1';
标签:127.0,管理,0.1,用户,laoliu,USER,mysql,user From: https://www.cnblogs.com/architectforest/p/18356774