涓銆侀棶棰樼幇璞
浣跨敤SQLyog杩炴帴MySQL8.0+鏁版嵁搴撴椂锛屾姤閿欙細
閿欒鍙风爜2058 Plugin caching_sha2_password could not be loaded
浜屻佸師鍥犲垎鏋
鍑虹幇杩欎釜闂锛屾槸鍥犱负 MySQL 浠 8.0 鐗堟湰寮濮嬶紝鏂板浜哻aching_sha2_password鎺堟潈鎻掍欢锛屽苟涓旀柊寤虹敤鎴锋椂榛樿浣跨敤璇ユ彃浠惰繘琛屽姞瀵嗭紝鑰屼綘鐨 SQLyog 鐗堟湰鏃犳硶璇嗗埆璇ュ姞瀵嗘柟寮忓姞瀵嗙殑瀵嗙爜銆
锛堝鏁版儏鍐典笅鏄綘鐨凷QLyog鐗堟湰杩囨椂浜嗭紝鏂扮殑SQLyog宸叉敮鎸佽瘑鍒玞aching_sha2_password鍔犲瘑鏂瑰紡鐨勫瘑鐮侊級
MySQL :: MySQL 8.0 Reference Manual :: 5.1.8 Server System Variables
涓夈佽В鍐虫柟妗
1. 鏂规1锛氭洿鏂癝QLyog鐗堟湰
鏌ョ湅浣犵殑SQLyog瀹夎璺緞涓嬶紝鏄惁鏈塩aching_sha2_password.dll鍔ㄦ佸簱锛屽鏋滄病鏈夊垯璇存槑浣犵殑SQLyog鐗堟湰锛屼笉鏀寔閫氳繃caching_sha2_password鍔犲瘑鐨勭敤鎴疯繘琛岃繛鎺ユ暟鎹簱銆
鏌ョ湅浜嗕竴涓婼QLyog鐨勫彂甯冨巻鍙诧細Version History - 2019 - SQLyog Knowledge Base (webyog.com)
浠嶴QLyog 13.1.3寮濮嬶紝鎵嶆敮鎸乧aching_sha2_password鎺堟潈鎻掍欢
濡傛灉浣犻渶瑕佹洿鏂癝QLyog锛屼綘鍙兘闇瑕 SQLyog 鍚勭増鏈笅杞戒笌瀹夎
2. 鏂规2锛氫慨鏀圭敤鎴风殑鎺堟潈鎻掍欢
浣跨敤鏈塵ysql.user琛ㄦ潈闄愮殑鐢ㄦ埛杩炴帴mysql骞舵墽琛屽涓嬪懡浠わ細
mysql> ALTER USER 'sqlyog'@'localhost' IDENTIFIED WITH mysql_native_password BY '1234qwer';
Query OK, 0 rows affected (0.03 sec)
mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.03 sec)
mysql> SELECT user,host,plugin FROM mysql.user;
+------------------+-----------+-----------------------+
| user | host | plugin |
+------------------+-----------+-----------------------+
| mysql.infoschema | localhost | caching_sha2_password |
| mysql.session | localhost | caching_sha2_password |
| mysql.sys | localhost | caching_sha2_password |
| root | localhost | caching_sha2_password |
| sqlyog | localhost | mysql_native_password |
+------------------+-----------+-----------------------+
5 rows in set (0.00 sec)
瑙i噴锛
ALTER USER 'sqlyog'@'localhost' IDENTIFIED WITH mysql_native_password BY '1234qwer'锛屼娇鐢╩ysql_native_password 鎺堟潈鎻掍欢鏇存柊鐢ㄦ埛瀵嗙爜锛宻qlyog@localhost鎹负鏇挎崲涓轰綘鑷繁鐨剈ser鍙奾ost
3. 鏂规3锛氫慨澶峬y.cnf 鎴 my.ini閰嶇疆鏂囦欢
鏌ユ壘閰嶇疆鏂囦欢锛堝鏋滀綘鐨刴ysql鏄畨瑁呭湪Window涓嬶級锛
C:\Users\Administrator>mysql --help | findstr "my.ini"
C:\WINDOWS\my.ini C:\WINDOWS\my.cnf C:\my.ini C:\my.cnf D:\Chen\MySoft\mysql-8.1.0-winx64\my.ini D:\Chen\MySoft\mysql-8.1.0-winx64\my.cnf
鏌ユ壘閰嶇疆鏂囦欢锛堝鏋滀綘鐨刴ysql鏄畨瑁呭湪Linux鎴杁ocker閲岋級锛
sh-4.4# mysql --help | grep 'my.cnf'
order of preference, my.cnf, $MYSQL_TCP_PORT,
/etc/my.cnf /etc/mysql/my.cnf /usr/etc/my.cnf ~/.my.cnf
鎸夐『搴忔壘閰嶇疆鏂囦欢锛屾壘鍒板悗鎵撳紑閰嶇疆鏂囦欢锛屽湪閰嶇疆鏂囦欢鐨刐mysqld]涓嬫坊鍔犲涓嬮厤缃細
default-authentication-plugin=mysql_native_password
鐒跺悗閲嶅惎mysql鏈嶅姟
Windows 涓婇噸鍚湇鍔
net stop mysqlnet start mysql
Linux 涓婇噸鍚湇鍔
systemctl stop mysqld
systemctl start mysqld
Docker 涓婇噸鍚痬ysql瀹瑰櫒
docker restart mysql81
mysql81浣跨敤浣犵殑 mysql瀹瑰櫒鍚嶇О鎴朓D鏇挎崲
閲嶅惎瀹屾垚鍚庯紝mysql鏈嶅姟浣跨敤鐨勯粯璁ゅ姞瀵嗘巿鏉冩彃浠跺氨鎴愪簡mysql_native_password锛岀劧鍚庢柊鍒涘缓鐨勭敤鎴峰鏋滀笉鎸囧畾鎺堟潈鎻掍欢锛岄偅涔堝垱寤哄畬鎴愬悗灏变娇鐢ㄩ粯璁ゆ彃浠跺姞瀵嗕簡銆
mysql> show variables like 'default_authentication_plugin';
+-------------------------------+-----------------------+
| Variable_name | Value |
+-------------------------------+-----------------------+
| default_authentication_plugin | mysql_native_password |
+-------------------------------+-----------------------+
1 row in set (0.01 sec)
mysql> CREATE USER 'sqlyog'@'%' IDENTIFIED BY '1234qwer';
Query OK, 0 rows affected (0.04 sec)
mysql> GRANT ALL PRIVILEGES ON *.* TO 'sqlyog'@'%';
Query OK, 0 rows affected (0.02 sec)
mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.01 sec)
mysql> SELECT user,host,plugin FROM mysql.user;
+------------------+-----------+-----------------------+
| user | host | plugin |
+------------------+-----------+-----------------------+
| root | % | caching_sha2_password |
| sqlyog | % | mysql_native_password |
| mysql.infoschema | localhost | caching_sha2_password |
| mysql.session | localhost | caching_sha2_password |
| mysql.sys | localhost | caching_sha2_password |
| root | localhost | caching_sha2_password |
+------------------+-----------+-----------------------+
6 rows in set (0.00 sec)
姝ゆ椂鍐嶄娇鐢ㄦ柊鍒涘缓鐨勭敤鎴凤紝灏卞彲浠ヨ繛鎺ysql8.0+鐨勬暟鎹簱浜嗐
娉ㄦ剰锛氬浜庡凡鏈夌殑鐢ㄦ埛锛屽鏋滀娇鐢ㄧ殑浠嶆槸caching_sha2_password鍔犲瘑鏂瑰紡锛岄偅涔堜粛鏃犳硶鐢⊿QLyog杩炴帴锛屼綘鍙互浣跨敤鏂规2锛岄噸鏂拌缃叾鍔犲瘑鏂瑰紡鍙婂瘑鐮併
鍥涖佹渶鍚庢荤粨
涓ユ牸鏉ヨ涓婅堪鏂规3銆佹柟妗2鏄竴鏍风殑锛堜笉澶帹鑽愭柟妗3锛夈
鏂规3浠呮槸灏嗘湇鍔″櫒榛樿鐨勬巿鏉冩彃浠舵敼涓轰簡mysql_native_password锛屽畠浠呭鏂板垱寤虹殑鐢ㄦ埛璧蜂綔鐢紙鍓嶆彁鏄垱寤虹敤鎴锋椂娌℃湁鎸囧畾鎺堟潈鎻掍欢锛夛紝骞朵笉浼氬奖鍝嶅凡鏈夌殑鐢ㄦ埛鐨勫姞瀵嗘柟寮忋傚鏋滄兂浣跨敤宸叉湁鐢ㄦ埛杩炴帴mysql锛岄渶浣跨敤鏂规2閲嶆柊璁剧疆鍏舵巿鏉冩彃浠跺強瀵嗙爜銆
鏂规1鏇存柊SQLyog鐨勬柟妗堣繕鏄煎緱灏濊瘯鐨勶紝姣曠珶鏄竴鍔虫案閫哥殑浜嬪効銆傛洿鏂癝QLyog 13.1.3+鍚庯紝鏃犺杩炴帴鐢ㄦ埛浣跨敤浠涔堟巿鏉冩彃浠讹紝閮藉彲杩炴帴涓娿
浠ヤ笂灏辨槸MYSQL:閿欒鍙风爜2058 Plugin caching_sha2_password could not be loaded鐨勮缁嗗唴瀹癸紝鏇村淇℃伅璇峰叧娉∣D浜戝叾瀹冪浉鍏虫枃绔狅紒