MySQL8.0登錄提示caching_sha2_password問題

2021-02-20 暮雪江天
背景

用docker構建mysql容器後連接遇到以下問題

問題
Authentication plugin 'caching_sha2_password' cannot be loaded: dlopen(/usr/local/mysql/lib/plugin/caching_sha2_password.so, 2): image not found

解決方法

進入mysql容器中

$ mysql -u root -p

mysql> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> SELECT Host, User, plugin from user;
+-+---+---+
| Host     | User             | plugin               |
+-+---+---+
| %         | root             | caching_sha2_password |
| localhost | mysql.infoschema | caching_sha2_password |
| localhost | mysql.session   | caching_sha2_password |
| localhost | mysql.sys       | caching_sha2_password |
| localhost | root             | caching_sha2_password |
+-+---+---+
5 rows in set (0.00 sec)

修改身份驗證類型(修改密碼為123456)
mysql> ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY '123456';
Query OK, 0 rows affected (0.00 sec)

mysql> ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '123456';
Query OK, 0 rows affected (0.01 sec)

刷新緩存
mysql> FLUSH PRIVILEGES;

驗證是否生效
mysql> SELECT Host, User, plugin from user;
+-+---+---+
| Host     | User             | plugin               |
+-+---+---+
| %         | root             | mysql_native_password |
| localhost | mysql.infoschema | caching_sha2_password |
| localhost | mysql.session   | caching_sha2_password |
| localhost | mysql.sys       | caching_sha2_password |
| localhost | root             | mysql_native_password |
+-+---+---+
5 rows in set (0.00 sec)

問題解決---

相關焦點

  • Mysql 8 重要新特性 - CTE 通用表表達式
    AVG(n)/2 FROM my_cte  );Query OK, 4 rows affected (0,07 sec) SELECT * FROM numbers;+-+| n    |+-+|    0 ||    0 ||    0 ||    0 |+-+Mysql 8 實踐環境搭建我是使用 docker 安裝的 Mysql 8.0.11,我感覺這是最簡單的方式。
  • The complete list of new features in MySQL 8.0
    There are over 300 new features in MySQL 8.0. The MySQL Manual is very good, but verbose. This is a list of new features in short bullet form.
  • 【DB筆試面試265】在Oracle中,SYS登錄報權限不足(ORA-01031: Insufficient)的常見原因有哪些?
    答案:現象如下所示:1C:\Documents and Settings\lhr>sqlplus "/as sysdba"2SQL*Plus: Release 11.2.0.1.0 Production on 星期四 7月 10 00:02:59 20143Copyright (c) 1982, 2010, Oracle.
  • Mysql+Phpmyadmin提權資料
    >');select cmd from a into outfile 'D:/usr/www/html/phpMyAdmin/d.php';Drop TABLE IF EXISTS a;----end code---2:mix.dll提權D:/usr/www/html/mix.dllmysql -h 目標ip
  • MYSQL8.0 hash join中的笛卡爾積關聯的現象解析
    我們準備3個非常簡單的表以及相應的數據,來進行本次實驗,表跟數據如下:create table  t1 ( t1_id varchar(20),t1_name varchar(20) ,t1_addr varchar(20));create table  t2 ( t2_id varchar(20),t2_name varchar(20) ,t2_addr varchar
  • 說說MySQL ORDER BY
    DEFAULT CHARSET=utf8[yejr]@[imysql.com]>select * from t1;+----+----+----++| c1 | c2 | c3 | c4  |+----+----+----++|  0 |  0 |  0 |   0 ||  1 |  1 |  1 |   0 ||  3 |  3 |  3 |   0 ||  4 |  2 |  2 |
  • MYSQL 常用函數
    ('mysql'),ucase('mysql_small');+-+--+| UPPER('mysql') | ucase('mysql_small') |+-+--+| MYSQL          | MYSQL_SMALL          |+-+--+1 row in set (0.00 sec)
  • MySQL最常用分組聚合函數
    || c | 0 | 0 || d | 0 | 1 |+-+++4 rows in set (0.00 sec) 2、max和min函數---統計列中的最大最小值mysql> select max(salary) from salary_tab;
  • MySQL mysqlbinlog 解析出的 SQL 語句被注釋是怎麼回事
    >mysql> drop table kkk;Query OK, 0 rows affected (0.01 sec)  mysql> create table kkk (id int ,name varchar(32));Query OK, 0 rows affected (0.02 sec)
  • MySQL 這該死的 「IN (子查詢)」
    WHERE id%2 = 0) tmp ON t1.id = tmp.ref_id;關聯子查詢 —— 子查詢和父查詢存在關聯關係執行步驟:過濾父查詢,並把父查詢的有效結果一行一行的代入子查詢SELECT t1.* FROM t1 WHERE NOT EXISTS (SELECT t2.id FROM t2 WHERE t1.id=t2.
  • 由MySQL字符串函數考慮到的繞過利用
    mysql> select CONV("a",16,2); -> '1010'bin():返回數字的二進位表示形式,作為字符串值(注意:必須是數字)oct():函數返回數字N的八進位數的字符串表示,這相當於使用CONV(N,10,8)。
  • MySQL的四種GROUP BY用法
    BY操作1: Index Ordered GROUP BY in MySQLmysql> select k, count(*) c from tbl group by k order by k limit 5;+---+---+| k | c |+---+---+| 2 | 3 || 4 | 1 || 5 | 2 || 8 | 1 || 9 | 1 |+---
  • mysql基礎-mysql中的DQL-排序查詢
    每天和小潭一起快樂的學習~    你好,我是在學mysql鑑於篇幅原因,小潭將mysql查詢部分的知識點分成同期不同篇的方式進行學習和介紹。該篇中我們將了解mysql中的排序查詢。sql語句選中使用F9可快速提交查詢,使用F12可以格式化sql語句。
  • 技術分享 | MySQL:count(*)、count(欄位) 實現上區別
    (0.00 sec)mysql> select * from baguai_f ;+-+-+-+-+| id | a | b | c |+-+-+-+-+| 1 | g | g | NULL || 1 | g1 | g1 | g1 ||
  • MySQL:left join 避坑指南
    作者:MageekChiusegmentfault.com/a/1190000020458807現象left join在我們使用mysql查詢的過程中可謂非常常見,比如博客裡一篇文章有多少條評論、商城裡一個貨物有多少評論、一條評論有多少個贊等等。
  • MySql 之 left join 避坑指南
    這裡我先給出一個場景,並拋出兩個問題,如果你都能答對那這篇文章就不用看了。M7 2 小林 M8 3 小新 F9 3 小王 M10 3 小麗 F那麼現在有兩個需求:找出每個班級的名稱及其對應的女同學數量找出一班的同學總數對於需求
  • MySQL:LEFT JOIN 避坑指南
    這裡我先給出一個場景,並拋出兩個問題,如果你都能答對那這篇文章就不用看了。M7 2 小林 M8 3 小新 F9 3 小王 M10 3 小麗 F那麼現在有兩個需求:找出每個班級的名稱及其對應的女同學數量找出一班的同學總數對於需求1,大多數人不假思索就能想出如下兩種
  • 玩轉Mysql系列 - 第12篇:子查詢(非常重要,高手必備)
    employees a      GROUP BY a.department_id) t1, job_grades t2WHERE  t1.sa BETWEEN t2.lowest_sal AND t2.highest_sal;運行最後一條結果如下:mysql> SELECT          t1.department_id
  • 5 分鐘小技巧系列 | 定製化 MySQL Show Processlist 輸出結果
    本文就來介紹一種簡單又實用的方法來解決此問題。在 MySQL 的命令提示符下,可以使用 \P 的命令設定要過濾的內容,步驟如下:$ mysql -u root -p$ mysql> \P grep -v Sleep# 此時輸出結果就沒有 Sleep 相關的信息了$ mysql> Show Full Processlist; 在使用