方法5:跳過授權列表skip-grant-tables

方法5:跳過授權列表skip-grant-tables

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

[root@node1 db]# mysql

ERROR 1045 (28000): Unknown error 1045

[root@node1 db]# vim /etc/my.cnf  #使用完後去掉

[mysqld]

skip-grant-tables=1

 

重啓mysql,再修改

[root@node1 db]# systemctl restart mysqld

[root@node1 db]# mysql

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

Your MySQL connection id is 2

Server version: 5.7.22 MySQL Community Server (GPL)

 

Copyright (c) 2000, 2018, 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> set password = PASSWORD('Reid4909@%&');

ERROR 1290 (HY000): Unknown error 1290

mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'Tom579#$%^&';

ERROR 1290 (HY000): Unknown error 1290

mysql> flush privileges;

Query OK, 0 rows affected (0.00 sec)

 

mysql> set password = PASSWORD('Reid4909@%&');

ERROR 1133 (42000):

mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'Tom579#$%^&';

Query OK, 0 rows affected (0.01 sec)

 

mysql> set password for root@localhost = password('123456');

Query OK, 0 rows affected, 1 warning (0.00 sec)

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章