[root@example-08 log]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 16
Server version: 5.7.26-29-57-log

Copyright (c) 2009-2019 Percona LLC and/or its affiliates
Copyright (c) 2000, 2019, 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.

# 如果是想直接 update mysql.user 的 table 的話,會出現以下錯誤
mysql> UPDATE mysql.user SET password=PASSWORD("passw0rd") where user='root';
ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.

# 請使用 alter user 指令來變更密碼
mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'passw0rd';
Query OK, 0 rows affected (0.01 sec)

# 如果有修改 mysql 使用者相關權限都建議再執行以下指令
mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)

undefined
Python大數據特訓班:資料自動化收集、整理、分析、儲存與應用實戰(附近300分鐘影音教學/範例程式)

作者: 文淵閣工作室  
出版社:碁峰  
 

arrow
arrow
    文章標籤
    linux percona mysql
    全站熱搜

    helloworld 發表在 痞客邦 留言(0) 人氣()