1. 程式人生 > 其它 >react中非同步action (redux-thunk)

react中非同步action (redux-thunk)

系統環境:centos7

資料庫版本:mysql Ver 14.14 Distrib 5.7.29, for linux-glibc2.12 (x86_64) using EditLine wrapper

一:首先要關閉資料庫,以什麼方式啟動的資料庫就要以什麼方式結束資料庫

1 [root@db01 ~]#systemctl stop mysql
2 [root@db01 ~]#ss -ntl
3 State       Recv-Q Send-Q               Local Address:Port                              Peer Address:Port              
4 LISTEN 0 128 *:22 *:* 5 LISTEN 0 128 [::]:22 [::]:*

:在命令列介面執行,如下命令,執行完成後,資料庫root賬戶的密碼就清空了

[root@db01 ~]#mysqld_safe --skip-grant-tables --skip-networking &
[
1] 15143 [root@db01 ~]#2020-12-14T12:13:17.814024Z mysqld_safe Logging to '/data/mysql/data/db01.err'. 2020-12-14T12:13:17.843723Z mysqld_safe Starting mysqld daemon with databases from /data/mysql/data

三: 登入資料庫,這個時候資料庫沒有密碼的,如下

[root@db01 ~]#mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection 
id is 2 Server version: 5.7.29 MySQL Community Server (GPL) Copyright (c) 2000, 2020, 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>

四:修改資料庫的密碼,如下

mysql> alter user root@localhost identified by '123456';
ERROR 1290 (HY000): The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement

在執行上述語句後,mysql會報錯,繼續執行如下語句,如下

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

再一次執行修改密碼的命令,如下,

mysql> alter user root@localhost identified by '123456';
Query OK, 0 rows affected (0.00 sec)

  出現如上資訊,說明資料庫密碼修改成功。

五:停止資料庫的程序並登入驗證資料庫

停止資料庫的相關程序

pkill mysqld

資料庫程序結束後,馬上要啟動資料庫
systemctl start mysqld
[root@db01 ~]#mysql -uroot -p123456
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.7.29 MySQL Community Server (GPL)

Copyright (c) 2000, 2020, 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> 

  由以上資訊可知,資料庫登入成功