Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
GuangZhan committed Jan 29, 2024
1 parent 3ca52e4 commit d2697cc
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions MySQL/MySQL创建用户.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,24 @@ user@host 表示授予的用户以及允许该用户登录的 IP 地址:

## 修改密码

8.0 之前

```sql
update mysql.user set password = password('test') where user = 'test' and host = '%';
flush privileges;
```

8.0 之后

```shell
use mysql;
alter USER 'root'@'localhost' IDENTIFIED BY 'nwe_password';
update user set host = "%" where user='root'; // 修改远程连接密码
update user set host = "localhost" where user='root'; // 修改本地连接密码
# 刷新权限
flush privileges;
```

## 删除用户

```sql
Expand Down

0 comments on commit d2697cc

Please sign in to comment.