<small id='CyxcC'></small><noframes id='CyxcC'>

<legend id='CyxcC'><style id='CyxcC'><dir id='CyxcC'><q id='CyxcC'></q></dir></style></legend>
  • <i id='CyxcC'><tr id='CyxcC'><dt id='CyxcC'><q id='CyxcC'><span id='CyxcC'><b id='CyxcC'><form id='CyxcC'><ins id='CyxcC'></ins><ul id='CyxcC'></ul><sub id='CyxcC'></sub></form><legend id='CyxcC'></legend><bdo id='CyxcC'><pre id='CyxcC'><center id='CyxcC'></center></pre></bdo></b><th id='CyxcC'></th></span></q></dt></tr></i><div id='CyxcC'><tfoot id='CyxcC'></tfoot><dl id='CyxcC'><fieldset id='CyxcC'></fieldset></dl></div>
    <tfoot id='CyxcC'></tfoot>
      • <bdo id='CyxcC'></bdo><ul id='CyxcC'></ul>

        MySQL 8.0 - 客户端不支持服务器请求的认证协议;

        时间:2023-08-17

          1. <small id='SKfnr'></small><noframes id='SKfnr'>

            • <bdo id='SKfnr'></bdo><ul id='SKfnr'></ul>
            • <legend id='SKfnr'><style id='SKfnr'><dir id='SKfnr'><q id='SKfnr'></q></dir></style></legend>
                <tbody id='SKfnr'></tbody>

              • <tfoot id='SKfnr'></tfoot>
              • <i id='SKfnr'><tr id='SKfnr'><dt id='SKfnr'><q id='SKfnr'><span id='SKfnr'><b id='SKfnr'><form id='SKfnr'><ins id='SKfnr'></ins><ul id='SKfnr'></ul><sub id='SKfnr'></sub></form><legend id='SKfnr'></legend><bdo id='SKfnr'><pre id='SKfnr'><center id='SKfnr'></center></pre></bdo></b><th id='SKfnr'></th></span></q></dt></tr></i><div id='SKfnr'><tfoot id='SKfnr'></tfoot><dl id='SKfnr'><fieldset id='SKfnr'></fieldset></dl></div>

                  本文介绍了MySQL 8.0 - 客户端不支持服务器请求的认证协议;考虑升级 MySQL 客户端的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  由于某种原因,我无法与服务器建立简单的连接.我安装了最新的 MySQL Community 8.0 数据库以及默认设置的 Node.JS.

                  I can't make a simple connection to the server for some reason. I install the newest MySQL Community 8.0 database along with Node.JS with default settings.

                  这是我的 node.js 代码

                      var mysql = require('mysql');
                  
                      var con = mysql.createConnection({
                        host: "localhost",
                        user: "root",
                        password: "password",
                        insecureAuth : true
                      });
                  
                      con.connect(function(err) {
                        if (err) throw err;
                        console.log("Connected!");
                      });
                  

                  以下是在命令提示符中发现的错误:

                  C:\Users\mysql-test>node app.js
                      C:\Users\mysql-test\node_modules\mysql\lib\protocol\Parse
                      r.js:80
                              throw err; // Rethrow non-MySQL errors
                              ^
                  
                  Error: ER_NOT_SUPPORTED_AUTH_MODE: Client does not support authentication protocol requested by server; consider upgrading MySQL client
                      at Handshake.Sequence._packetToError (C:\Users\mysql-
                  test\node_modules\mysql\lib\protocol\sequences\Sequence.js:52:14)
                      at Handshake.ErrorPacket (C:\Users\mysql-test\node_mo
                  dules\mysql\lib\protocol\sequences\Handshake.js:130:18)
                      at Protocol._parsePacket (C:\Users\mysql-test\node_mo
                  dules\mysql\lib\protocol\Protocol.js:279:23)
                      at Parser.write (C:\Users\mysql-test\node_modules\mys
                  ql\lib\protocol\Parser.js:76:12)
                      at Protocol.write (C:\Users\mysql-test\node_modules\m
                  ysql\lib\protocol\Protocol.js:39:16)
                      at Socket.<anonymous> (C:\Users\mysql-test\node_modul
                  es\mysql\lib\Connection.js:103:28)
                      at Socket.emit (events.js:159:13)
                      at addChunk (_stream_readable.js:265:12)
                      at readableAddChunk (_stream_readable.js:252:11)
                      at Socket.Readable.push (_stream_readable.js:209:10)
                      --------------------
                      at Protocol._enqueue (C:\Users\mysql-test\node_module
                  s\mysql\lib\protocol\Protocol.js:145:48)
                      at Protocol.handshake (C:\Users\mysql-test\node_modul
                  es\mysql\lib\protocol\Protocol.js:52:23)
                      at Connection.connect (C:\Users\mysql-test\node_modul
                  es\mysql\lib\Connection.js:130:18)
                      at Object.<anonymous> (C:\Users\mysql-test\server.js:
                  11:5)
                  at Module._compile (module.js:660:30)
                  at Object.Module._extensions..js (module.js:671:10)
                  at Module.load (module.js:573:32)
                  at tryModuleLoad (module.js:513:12)
                  at Function.Module._load (module.js:505:3)
                  at Function.Module.runMain (module.js:701:10)
                  

                  我已经阅读了一些内容,例如:https://dev.mysql.com/doc/refman/5.5/en/old-client.htmlhttps://github.com/mysqljs/mysql/issues/1507

                  I've read up on some things such as: https://dev.mysql.com/doc/refman/5.5/en/old-client.html https://github.com/mysqljs/mysql/issues/1507

                  但我仍然不确定如何解决我的问题.任何帮助将不胜感激:D

                  But I am still not sure how to fix my problem. Any help would be appreciated :D

                  推荐答案

                  在MYSQL Workbench中执行以下查询

                  Execute the following query in MYSQL Workbench

                  ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';

                  其中 root 作为您的用户localhost 作为你的 URL和 password 作为你的密码

                  Where root as your user localhost as your URL and password as your password

                  然后运行此查询以刷新权限:

                  Then run this query to refresh privileges:

                  刷新权限;

                  完成后尝试使用节点连接.

                  Try connecting using node after you do so.

                  如果这不起作用,请在没有 @'localhost' 部分的情况下尝试.

                  If that doesn't work, try it without @'localhost' part.

                  这篇关于MySQL 8.0 - 客户端不支持服务器请求的认证协议;考虑升级 MySQL 客户端的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:在 MYSQL 中加入带有 SUM 问题的表 下一篇:带有 Node.js 的 MySQL

                  相关文章

                  最新文章

                  <tfoot id='3vnUa'></tfoot>
                1. <i id='3vnUa'><tr id='3vnUa'><dt id='3vnUa'><q id='3vnUa'><span id='3vnUa'><b id='3vnUa'><form id='3vnUa'><ins id='3vnUa'></ins><ul id='3vnUa'></ul><sub id='3vnUa'></sub></form><legend id='3vnUa'></legend><bdo id='3vnUa'><pre id='3vnUa'><center id='3vnUa'></center></pre></bdo></b><th id='3vnUa'></th></span></q></dt></tr></i><div id='3vnUa'><tfoot id='3vnUa'></tfoot><dl id='3vnUa'><fieldset id='3vnUa'></fieldset></dl></div>
                    <bdo id='3vnUa'></bdo><ul id='3vnUa'></ul>
                  <legend id='3vnUa'><style id='3vnUa'><dir id='3vnUa'><q id='3vnUa'></q></dir></style></legend>

                      <small id='3vnUa'></small><noframes id='3vnUa'>