国产 无码 综合区,色欲AV无码国产永久播放,无码天堂亚洲国产AV,国产日韩欧美女同一区二区

error 2059: Authentication plugin ‘caching_sha2_password‘ cannot be loaded: /usr/lib64/mysql/plugin/

這篇具有很好參考價值的文章主要介紹了error 2059: Authentication plugin ‘caching_sha2_password‘ cannot be loaded: /usr/lib64/mysql/plugin/。希望對大家有所幫助。如果存在錯誤或未考慮完全的地方,請大家不吝賜教,您也可以點擊"舉報違法"按鈕提交疑問。

Mysql學習中,嘗試遠程登錄報(2059)錯誤:(從虛擬機登錄到本地的mysql8.0.26版本)

報錯內(nèi)容

error 2059: Authentication plugin ‘caching_sha2_password‘ cannot be loaded: /usr/lib64/mysql/plugin/

error 2059: Authentication plugin 'caching_sha2_password' cannot be loaded: /usr/lib64/mysql/plugin/caching_sha2_password.so: cannot open shared object file: No such file or directory

操作內(nèi)容

想要實現(xiàn)mysql的遠程登錄
我的嘗試,從虛擬機登錄到本地mysql

解決方法(針對mysql8.0后的版本)

方法一:
修改密碼的加密方式,對后續(xù)的新建用戶有效(在添加下述語句后,后續(xù)的新用戶加密方式默認被改為了mysql_native_password),而前期的老用戶默認密碼加密方式還是(caching_sha2_password)
找到my.ini文件,在[mysqld]下添加

default_authentication_plugin=mysql_native_password

保存,重啟mysql服務,重啟mysql服務,重啟mysql服務?。。?!生效。
error 2059: Authentication plugin ‘caching_sha2_password‘ cannot be loaded: /usr/lib64/mysql/plugin/

老用戶需要手動修改為mysql_native_password

ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'root'; #更新一下用戶的密碼
FLUSH PRIVILEGES; #刷新權(quán)限

方法二:
沒有所謂的方法二,就跟上面的一樣。不過是,創(chuàng)建一個新用戶,指定加密方式,賦予所有權(quán)限,用新用戶連接mysql(哈哈)

-- 創(chuàng)建用戶名為hyl,設所有ip均可登錄,密碼root
create user hyl@'%' identified WITH mysql_native_password BY 'root';
-- grant給hyl賦予所有的庫和表的權(quán)限。
grant all privileges on *.* to hyl@'%' with grant option;
-- 刷新
flush privileges;

錯誤原因

新版本的MySQL新特性導致,導致認證方式有問題。

MySQL8.0版本默認的認證方式是caching_sha2_password
error 2059: Authentication plugin ‘caching_sha2_password‘ cannot be loaded: /usr/lib64/mysql/plugin/

而在MySQL5.7版本則為mysql_native_password
error 2059: Authentication plugin ‘caching_sha2_password‘ cannot be loaded: /usr/lib64/mysql/plugin/

學到的知識

創(chuàng)建新用戶: 其中username為自定義的用戶名;host為登錄域名,host為’%'時表示為 任意IP,為localhost時表示本機,或者填寫指定的IP地址;paasword為密碼

create user 'username'@'host' identified by 'password'; 

為用戶授權(quán): 其中*.第一個表示所有數(shù)據(jù)庫,第二個表示所有數(shù)據(jù)表,如果只是部分授權(quán)那就把對應的寫成相應數(shù)據(jù)庫或者數(shù)據(jù)表;username為指定的用戶;%為該用戶登錄的域名

grant 權(quán)限 on . to ‘username’@‘%’
grant 權(quán)限 on . to ‘username’@‘%’ identified by “密碼”

grant all privileges on *.* to 'username'@'%' with grant option; 
  • *.*第一個 * 表示所有數(shù)據(jù)庫,第二個 * 表示所有數(shù)據(jù)表
  • privileges(權(quán)限列表),可以是all priveleges, 表示所有權(quán)限,也可以是select、update等權(quán)限,多個權(quán)限的名詞,相互之間用逗號分開。
  • on用來指定權(quán)限針對哪些庫和表。
  • to 表示將權(quán)限賦予某個用戶,@后面接限制的主機,可以是IP,IP段,域名以及%,%表示任何地方。
  • 注意:這里%有的版本不包括本地,以前碰到過給某個用戶設置了%允許任何地方登錄,但是在本地登錄不了,這個和版本有關(guān)系,遇到這個問題再加一個localhost的用戶就可以了。
  • WITH GRANT OPTION 這個選項表示該用戶可以將自己擁有的權(quán)限授權(quán)給別人。

舉例:

用戶名:ad,密碼:ad_pass,登陸ip:192.168.0.10
//用戶在所有登陸ip的權(quán)限
grant all on *.* to 'ad'@'%' identified by "ad_pass";
  
//開放管理MySQL中所有數(shù)據(jù)庫的權(quán)限
grant all on *.* to 'ad'@'192.168.0.10' identified by "ad_pass";

//開放管理MySQL中具體數(shù)據(jù)庫(test)的權(quán)限
grant all privileges on test to 'ad'@'192.168.0.10' identified by "ad_pass";

//開放管理MySQL中具體數(shù)據(jù)庫中的表(test.table1)的權(quán)限
grant all on test.table1 to 'ad'@'192.168.0.10' identified by "ad_pass"

//開放管理MySQL中具體數(shù)據(jù)庫的表(test.table1)的部分列的權(quán)限
grant select(id,se,rank) on test.table1 to 'ad'@'192.168.0.10' identified by "ad_pass";

//開放管理操作指令
grant select,insert,update,delete on test.* to 'ad'@'192.168.0.10' identified by "ad_pass";

權(quán)限的收回

#收回權(quán)限(不包含賦權(quán)權(quán)限)
REVOKE ALL PRIVILEGES ON *.* FROM 'username'@'%';
#收回賦權(quán)權(quán)限
REVOKE GRANT OPTION ON *.* FROM 'username'@'%';

#操作完后重新刷新權(quán)限
flush privileges;

結(jié)果測試(用戶‘ll’測試)

老用戶采用默認的caching_sha2_password (登錄失?。?br>error 2059: Authentication plugin ‘caching_sha2_password‘ cannot be loaded: /usr/lib64/mysql/plugin/

error 2059: Authentication plugin ‘caching_sha2_password‘ cannot be loaded: /usr/lib64/mysql/plugin/
修改 ‘ll’ 的加密方式為 mysql_native_password

ALTER USER 'll'@'%' IDENTIFIED WITH mysql_native_password BY 'root'; 

error 2059: Authentication plugin ‘caching_sha2_password‘ cannot be loaded: /usr/lib64/mysql/plugin/error 2059: Authentication plugin ‘caching_sha2_password‘ cannot be loaded: /usr/lib64/mysql/plugin/

總結(jié)

自己真的是菜的離譜,對于sql的DCL語句陌生的很,問題其實很簡單,但是我還是花了好長時間才搞懂這么一丟丟。哎,繼續(xù)加油~文章來源地址http://www.zghlxwxcb.cn/news/detail-488662.html

到了這里,關(guān)于error 2059: Authentication plugin ‘caching_sha2_password‘ cannot be loaded: /usr/lib64/mysql/plugin/的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!

本文來自互聯(lián)網(wǎng)用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權(quán),不承擔相關(guān)法律責任。如若轉(zhuǎn)載,請注明出處: 如若內(nèi)容造成侵權(quán)/違法違規(guī)/事實不符,請點擊違法舉報進行投訴反饋,一經(jīng)查實,立即刪除!

領支付寶紅包贊助服務器費用

相關(guān)文章

  • MYSQL解決“plugin caching_sha2_password could not be loaded”

    MYSQL解決“plugin caching_sha2_password could not be loaded”

    目錄 ????????1. 登錄mysql ????????2.查看用戶的密碼規(guī)則,及對應host? ????????3.修改加密規(guī)則及密碼(注意:下面代碼的 % 是對應host中的內(nèi)容) 概述 “ plugin caching_sha2_password could not be loaded”,是無法加載插件緩存sha2密碼,?在MySQL 8.0中,caching_sha2_password是默認的

    2024年02月07日
    瀏覽(31)
  • 遠程連接MySQL錯誤“plugin caching_sha2_password could not be loaded”的解決辦法sql連接亂碼

    遠程連接MySQL錯誤“plugin caching_sha2_password could not be loaded”的解決辦法sql連接亂碼

    今天在阿里云租了一個服務器,當我用sqlyog遠程連接mysql時,報了plugin caching_sha2_password could not be loaded錯,即無法加載插件緩存sha2密碼,但是我在cmd窗口就可以訪問,在網(wǎng)上找了很多解決方法都沒有解決,最后找到了原因。在MySQL 8.0中,caching_sha2_password是默認的身份驗證插件

    2024年02月07日
    瀏覽(23)
  • MySQL 8.0.31 登錄提示caching_sha2_password問題解決方法

    MySQL 8.0.31 使用了 caching_sha2_password 作為默認的身份驗證插件,這可能導致一些舊的客戶端和庫無法連接到服務器。以下是一些解決此類問題的常見步驟和建議: 確保MySQL服務正在運行:首先,確保你的MySQL服務器實例正在運行。你可以使用系統(tǒng)的服務管理工具來檢查。 更新你

    2024年02月12日
    瀏覽(24)
  • 連接MySQL 8.0時報錯caching_sha2_password解決方案

    由于我安裝的mysql 8.0,8.0和5.x其中一個改動就是加密認證方式發(fā)生改變: caching_sha2_password是8.0 mysql_native_password是5.x 更改mysql的jdbc版本 直接在xx.pom修改版本號即可。 mysql jdbc的maven鏈接:http://mvnrepository.com/artifact/mysql/mysql-connector-java 比如:

    2024年02月11日
    瀏覽(20)
  • Navicat連接mysql8.0:提示無法加載身份驗證插件“caching_sha2_password”

    Navicat連接mysql8.0:提示無法加載身份驗證插件“caching_sha2_password”

    Navicat連接mysql時,提示:Unable to load authentication plugin ‘caching_sha2_password‘. 原因:mysql 8.0 默認使用 caching_sha2_password 身份驗證機制。 更改過程: MYSQL8.0開啟遠程鏈接

    2024年02月09日
    瀏覽(21)
  • MGR新節(jié)點RECOVERING狀態(tài)的分析與解決:caching_sha2_password驗證插件的影響

    MGR新節(jié)點RECOVERING狀態(tài)的分析與解決:caching_sha2_password驗證插件的影響

    在GreatSQL社區(qū)上有一位用戶提出了“手工構(gòu)建MGR碰到的次節(jié)點一直處于recovering狀態(tài)”,經(jīng)過排查后,發(fā)現(xiàn)了是因為新密碼驗證插件 caching_sha2_password 導致的從節(jié)點一直無法連接主節(jié)點,帖子地址:(https://greatsql.cn/thread-420-2-1.html)) 本文驗證環(huán)境,以及本文所采用數(shù)據(jù)庫為 Gre

    2024年02月09日
    瀏覽(22)
  • Sqlyog 無法連接 8 版本的mysql caching_sha2_password could not be loaded

    Sqlyog 無法連接 8 版本的mysql caching_sha2_password could not be loaded

    近期系統(tǒng)對Mysql 版本進行了升級,由原來的 5.7升至 8版本,在現(xiàn)場使用Sqlyog 作為數(shù)據(jù)庫連接軟件時,發(fā)現(xiàn)連接失敗。 使用Sqlyog配置完連接信息后點擊連接,報錯: MySQL 8.0中修改了默認的密碼加密方式,使用了caching_sha2_password加密方式,對于Sqlyog老版本不支持該方式,從13.

    2024年02月06日
    瀏覽(22)
  • 使用pymysql報錯RuntimeError ‘cryptography‘ package is required for sha256_password or caching_sha2_passw

    使用pymysql報錯RuntimeError ‘cryptography‘ package is required for sha256_password or caching_sha2_passw

    使用pymysql連接MySql數(shù)據(jù)庫報錯RuntimeError: 該錯誤提示的意思是:sha256_password和caching_sha2_password兩種加密方式需要cryptography。 所以只需要安裝一下cryptography包就可以了: 安裝完成后,重新執(zhí)行, 就ok了。

    2024年02月08日
    瀏覽(21)
  • Geth --- Error: authentication needed: password or unlock

    Geth --- Error: authentication needed: password or unlock

    Error: authentication needed: password or unlock ??在調(diào)用sendTransaction()進行轉(zhuǎn)賬時報錯,意思是用戶未解鎖。 ??新用戶默認是上鎖的,交易前需要先解鎖。 ??如下圖,解鎖要交易的兩個用戶 ??解鎖后再交易,交易提交成功。 ? 參考鏈接: https://blog.miuyun.work ? 如有不對,煩請指出,

    2024年02月13日
    瀏覽(14)
  • PostgreSQL數(shù)據(jù)庫連接報錯:psql: error: FATAL: password authentication failed for user “postgres“

    PostgreSQL數(shù)據(jù)庫連接報錯:psql: error: FATAL: password authentication failed for user “postgres“

    環(huán)境如下,使用yum方式安裝PostgreSQL hostname IP地址 操作系統(tǒng)版本 PostgreSQL版本 jeven 192.168.3.166 centos 7.6 13.10 PostgreSQL(經(jīng)常被簡稱為Postgres)是一個開源的關(guān)系型數(shù)據(jù)庫管理系統(tǒng),它基于SQL語言實現(xiàn)了所有主流功能,支持事務處理、并發(fā)控制、復雜查詢、外鍵、觸發(fā)器、存儲過程

    2024年02月04日
    瀏覽(21)

覺得文章有用就打賞一下文章作者

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

請作者喝杯咖啡吧~博客贊助

支付寶掃一掃領取紅包,優(yōu)惠每天領

二維碼1

領取紅包

二維碼2

領紅包