2000字范文,分享全网优秀范文,学习好帮手!
2000字范文 > mysql查询修改 ubuntu修改mysql密码 – 数据库 – 前端 mysql duplicate key

mysql查询修改 ubuntu修改mysql密码 – 数据库 – 前端 mysql duplicate key

时间:2024-02-18 20:29:57

相关推荐

mysql查询修改 ubuntu修改mysql密码 – 数据库 – 前端 mysql duplicate key

sudo -s

1

1

然后输入命令mysql

root@ubuntu:/home/cdd/Desktop/Django/typeidea-env/typeidea/typeidea# mysql

Welcome to the MySQL monitor. Commands end with ; or \g.

Your MySQL connection id is 22

Server version: 8.0.21-0ubuntu0.20.04.4 (Ubuntu)

Copyright (c) 2000, , Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its

affiliates. Other names may be trademarks of their respective

owners.

Type help; or \h for help. Type \c to clear the current input statement.

mysql>

1

2

3

4

5

6

7

8

9

10

11

12

13

14

1

2

3

4

5

6

7

8

9

10

11

12

13

14

下面就是修改初始密码的步骤:

现在mysql命令下输入

mysql> use mysql

1

1

然后修改密码:

mysql> ALTER USER oot@localhost IDENTIFIED WITH caching_sha2_password BY 你的新密码;

1

1

到这里新密码就设置好了,下面大家登录下:

$ mysql -u root -p

Enter password: # 这里输入你的新密码

Welcome to the MySQL monitor. Commands end with ; or \g.

Your MySQL connection id is 28

Server version: 8.0.21-0ubuntu0.20.04.4 (Ubuntu)

Copyright (c) 2000, , Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its

affiliates. Other names may be trademarks of their respective

owners.

Type help; or \h for help. Type \c to clear the current input statement.

mys

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。