# 修改本地登陆
# 修改密码过期规则----》永不过期
ALTER USER 'root'@'localhost' IDENTIFIED BY '123456' PASSWORD EXPIRE NEVER;
# 更新用户的密码修改加密规则
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '123456';
# 刷新权限
FLUSH PRIVILEGES;
# 重置密码(==非必须==)
ALTER USER 'root'@'localhost' IDENTIFIED BY '123456';
# 修改远程登陆
# 修改密码过期规则----》永不过期
ALTER USER 'root'@'%' IDENTIFIED BY '123456' PASSWORD EXPIRE NEVER;
# 更新用户的密码修改加密规则
ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY '123456';
# 刷新权限
FLUSH PRIVILEGES;
# 重置密码(==非必须==)
ALTER USER 'root'@'%' IDENTIFIED BY '123456';
mysql配置远程登陆
最新推荐文章于 2024-08-15 11:56:37 发布