简体   繁体   English

NodeJS/mySQL - ER_ACCESS_DENIED_ERROR 用户 'root'@'localhost' 的访问被拒绝(使用密码:是)

[英]NodeJS/mySQL - ER_ACCESS_DENIED_ERROR Access denied for user 'root'@'localhost' (using password: YES)

I am attempting to connect to mySQL through a NodeJS file, but I receive the following error:我试图通过 NodeJS 文件连接到 mySQL,但我收到以下错误:

{ Error: ER_ACCESS_DENIED_ERROR: Access denied for user 'root'@'localhost' (using password: YES)
    at Handshake.Sequence._packetToError (/home/matthew/Node/mySqlTest/node_modules/mysql/lib/protocol/sequences/Sequence.js:30:14)
    at Handshake.ErrorPacket (/home/matthew/Node/mySqlTest/node_modules/mysql/lib/protocol/sequences/Handshake.js:67:18)
    at Protocol._parsePacket (/home/matthew/Node/mySqlTest/node_modules/mysql/lib/protocol/Protocol.js:197:24)
    at Parser.write (/home/matthew/Node/mySqlTest/node_modules/mysql/lib/protocol/Parser.js:62:12)
    at Protocol.write (/home/matthew/Node/mySqlTest/node_modules/mysql/lib/protocol/Protocol.js:37:16)
    at Socket.ondata (_stream_readable.js:555:20)
    at emitOne (events.js:101:20)
    at Socket.emit (events.js:188:7)
    at readableAddChunk (_stream_readable.js:176:18)
    at Socket.Readable.push (_stream_readable.js:134:10)
    --------------------
    at Protocol._enqueue (/home/matthew/Node/mySqlTest/node_modules/mysql/lib/protocol/Protocol.js:110:26)
    at Protocol.handshake (/home/matthew/Node/mySqlTest/node_modules/mysql/lib/protocol/Protocol.js:42:41)
    at Connection.connect (/home/matthew/Node/mySqlTest/node_modules/mysql/lib/Connection.js:81:18)
    at Connection._implyConnect (/home/matthew/Node/mySqlTest/node_modules/mysql/lib/Connection.js:222:10)
    at Connection.query (/home/matthew/Node/mySqlTest/node_modules/mysql/lib/Connection.js:137:8)
    at Object.<anonymous> (/home/matthew/Node/mySqlTest/index.js:11:12)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
  code: 'ER_ACCESS_DENIED_ERROR',
  errno: 1045,
  sqlState: '28000',
  fatal: true }

The weird thing is that I can connect fine through the terminal by running mysql -u root -p .奇怪的是,我可以通过运行mysql -u root -p通过终端正常连接。 I only get this error when running my javascript. I have been all over Google and StackOverflow, but still have not found a solution that works.我只在运行我的 javascript 时遇到此错误。我已经遍历了 Google 和 StackOverflow,但仍然没有找到有效的解决方案。 I am using MySQL 5.7.16 on Ubuntu 16.04.1 on a VIRTUAL MACHINE.我在虚拟机上使用 MySQL 5.7.16 on Ubuntu 16.04.1。 Not sure if a VM makes a difference here.不确定 VM 在这里是否有所作为。 My Javascript code is below:我的 Javascript 代码如下:

'use strict';                                                                                                                                      

var mysql = require('mysql');

var connection = mysql.createConnection({
    host: 'localhost',
    user: 'root',
    password: 'password'
});

connection.query(
    'SELECT "foo" AS first_field, "bar" AS second_field',
    function(err, results, fields) {
        console.log(err);
        console.log(results);
        connection.end();
    }
);

I have tried using 'locahost' as well as '127.0.0.1' in my javascript. I have a 'root' user for both 'localhost' and '127.0.0.1' in mySql.user table and I am able to see this by executing SELECT user, host FROM mysql.user WHERE user='root';我尝试在我的 javascript 中使用“locahost”和“127.0.0.1”。我在 mySql.user 表中有一个“root”用户用于“localhost”和“127.0.0.1”,我可以通过执行SELECT user, host FROM mysql.user WHERE user='root';

I have added privileges to 'root' user by executing this:我通过执行以下命令为“root”用户添加了权限:

GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED BY 'password';

I ran the above on 127.0.0.1 as well.我也在 127.0.0.1 上运行了上面的代码。 I have also tried this:我也试过这个:

GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION

I have attempted to reset the root password like this: https://help.ubuntu.com/community/MysqlPasswordReset我试图像这样重置根密码: https://help.ubuntu.com/community/MysqlPasswordReset

I have run FLUSH PRIVILEGES after each attempt.每次尝试后我都运行了FLUSH PRIVILEGES I've stopped and restarted mySQL. I have uninstalled mySQL completely and reinstalled.我已经停止并重新启动 mySQL。我已经完全卸载 mySQL 并重新安装。

All to no avail.都无济于事。 I receive the access denied error every time I try to run the javascript, but I have absolutely no issues when I connect to mySQL via the terminal.每次我尝试运行 javascript 时,我都会收到访问被拒绝的错误,但是当我通过终端连接到 mySQL 时,我完全没有问题。

Any ideas?有任何想法吗?

I have the same problem, I solved it by changing the password to empty string.我有同样的问题,我通过将密码更改为空字符串来解决它。

var mysql = require('mysql');
var connection = mysql.createConnection({
    host: 'localhost',
    user: 'root',
    password: ''
});

Try adding a port field:尝试添加一个端口字段:

var connection = mysql.createConnection({
   host: 'localhost',
   user: 'root',
   password: 'password',
   port: 3307
});

Create new user (instead of using root) fixed my problem.创建新用户(而不是使用 root)解决了我的问题。

mysql> CREATE USER 'new_user'@'%' IDENTIFIED BY 'password';
Query OK, 0 rows affected (0.00 sec)

Then grant:然后授予:

mysql> GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, PROCESS, REFERENCES, INDEX, ALTER, SHOW DATABASES, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER ON *.* TO 'new_user'@'%' WITH GRANT OPTION;

Then change the credentials:然后更改凭据:

  var connection = mysql.createConnection({
    host     : 'The mysql IP',
    port     : 'The mysql Port',
    user     : 'new_iser',
    password : 'new_user_pass',
    database : 'database-name'
  }); 

I had a similar problem.我有一个类似的问题。 I was running mysql in a Docker container and had the same error when trying to connect to it from my node app.我在 Docker 容器中运行 mysql 并且在尝试从我的节点应用程序连接到它时遇到了同样的错误。

It appeared, that I had run the Docker container without exposing the port, hence it was 3306 inside the container, but would not have been accessible through localhost:3306.看来,我在没有暴露端口的情况下运行了 Docker 容器,因此容器内是 3306,但无法通过 localhost:3306 访问。 Why I got ER_ACCESS_DENIED_ERROR error was because I actually had some other mysql server running on the port 3306, with different username and password.为什么我得到 ER_ACCESS_DENIED_ERROR 错误是因为我实际上在端口 3306 上运行了一些其他 mysql 服务器,使用不同的用户名和密码。

To see if or what you have running on the specific port type:要查看您是否在特定端口类型上运行或运行了什么:

ps axu | grep 3306

Since I already had something on port 3306, to make the server accessible to my app I changed a port to 3307 and run my docker mysql container with the command:由于我已经在端口 3306 上有了一些东西,为了使我的应用程序可以访问服务器,我将端口更改为 3307 并使用以下命令运行我的 docker mysql 容器:

docker run --name=<name> -e MYSQL_ROOT_PASSWORD=<password> -p 3307:3306 -d mysql

After starting mysql client inside Docker with command:使用命令在 Docker 中启动 mysql 客户端后:

docker exec -it <name> mysql -u root -p

And after creating a database to connect to, I was able to connect to my mysql db from my node app with these lines:在创建要连接的数据库之后,我可以使用以下几行从我的节点应用程序连接到我的 mysql 数据库:

 const connection = mysql.createConnection({
    host: 'localhost',
    user: 'root',
    password: 'password',
    database: 'database',
    port: 3307
 });

 connection.connect();

Hopefully helps someone new to docker and mysql :)希望对 docker 和 mysql 的新手有所帮助 :)

The problem is not with the mysql user authentication.问题不在于 mysql 用户身份验证。 It just that you have to grant your node application to access mysql db.只是您必须授予节点应用程序访问 mysql db 的权限。 I was facing the same issue earlier.I added the port number on which my node application is running.And its working perfectly fine now.我之前遇到了同样的问题。我添加了运行节点应用程序的端口号。现在它工作得很好。

Also user:"root" was written as username:"root" . user:"root" 也写为 username:"root" 。 Be careful with the spellings.小心拼写。

const mysqlConnection = mysql.createConnection({
host: "localhost",
user: "root",
password: "Pass@123",
database: "employees",
port:"3000",
multipleStatements: true

}); });

I am using mysql version "mysql": "^2.18.1".我正在使用 mysql 版本“mysql”:“^2.18.1”。

For mysql version 2.16.0 (Sept 2018):对于 mysql 版本 2.16.0(2018 年 9 月):

just create a new user on mysql.只需在mysql上创建一个新用户。

GRANT ALL PRIVILEGES ON *.* TO 'username'@'localhost' IDENTIFIED BY 'password';

replace username and password.替换用户名和密码。

A bit late to talk about it but I guess I found the problem: special chars in password!!!有点晚了,但我想我发现了问题:密码中的特殊字符!!! I had a $ in pass.我有一个 $ 通行证。 Solution: use escape Ex: te\$t解决方案:使用转义 Ex: te\$t

const pool = mysql.createPool({ host: 'localhost', user: 'root', database: 'database_name', password: 'your_pwd' });

make sure you have spelled the the keys and the properly.确保您已经正确拼写了密钥。 I was facing similar issue, then realised that I had written username instead of user我遇到了类似的问题,然后意识到我写的是用户名而不是用户

Using recent MySQL version in package.json solved the problem.package.json中使用最新的 MySQL 版本解决了这个问题。

I was using version 2.0.0.我使用的是 2.0.0 版。 I changed the version to 2.10.2.我将版本更改为 2.10.2。

I had the same problem and changing password of database user worked for me.我遇到了同样的问题,更改数据库用户的密码对我有用。 Follow these steps :按着这些次序 :

  1. Open MySQL Workbench打开MySQL Workbench

  2. Open Local instance MySQL57 using old password使用旧密码打开Local instance MySQL57

  3. Go to Server > Users and Privileges转到Server > Users and Privileges

  4. Change password, and login to MySQL again.更改密码,然后再次登录 MySQL。 OR Create a newuser and set privileges. OR创建一个新用户并设置权限。 (If changing password do not work.) (如果更改密码不起作用。)

//surprisingly this works. //令人惊讶的是,这有效。

var mysql = require('mysql');
var con = mysql.createConnection({
  host: "localhost",
  user: "root",
  password: ""
});

con.connect(function(err) {
  if (err) throw err;
  console.log("Connected!");
});

If anyone is still facing problem.如果有人仍然面临问题。 Try尝试

var mysql = require("mysql");
var con = mysql.createConnection({
  host: "127.0.0.1",
  user: "your_username",
  password: "password",
  database: "your_db_name"
});

Try n make sure that you use the credentials that you use to login your database are correct尝试 n 确保您使用用于登录数据库的凭据是正确的

const Sequelize = require('sequelize')
const db = {}
const sequelize = new Sequelize('ochiengsDatabase', 'ochienguser', ' 
mydbpassword', {
host: 'localhost',
dialect: 'mysql',
operatorsAliases: false,

You had to add the new user with an IP of the allowed host section not of the name of "localhost"您必须使用允许的主机部分的 IP 添加新用户,而不是“localhost”的名称

// Do the mySQL Stuff
var con = mysql.createConnection({
  host: 'localhost',
  user: 'user',
  password: 'mypwd',
  database: 'database',
  port: 3306,
  debug: true
});

//MYSQL Statement

RENAME USER 'myuser'@'localhost' TO 'myuser'@'127.0.0.1';

I was getting the same issue, but using require('mariadb') , which is essentially the same.我遇到了同样的问题,但是使用require('mariadb') ,这基本上是相同的。 So my answer should apply to both drivers.所以我的回答应该适用于两个司机。

The problem was 2 fold:问题是 2 倍:

  • host: 'localhost', user: 'user' is always resolving as 'user'@'127.0.0.1' on the database. host: 'localhost', user: 'user'在数据库上总是解析为'user'@'127.0.0.1' So don't use localhost but 127.0.0.1 instead!所以不要使用localhost而是使用127.0.0.1

  • The password encryption scheme was incompatible between client and server, apparently the Node client is using mysql_native_password .客户端和服务器之间的密码加密方案不兼容,显然 Node 客户端使用的是mysql_native_password

Here's the solution : (from the mysql command-line client)这是解决方案:(来自mysql命令行客户端)

# If you don't have a 127.0.0.1 equivalent user:
CREATE USER 'root'@'127.0.0.1' IDENTIFIED WITH mysql_native_password BY 'password';

# If you already have the user, reset its password:         
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';

# Redo your grants on the 127.0.0.1 user:
GRANT ALL PRIVILEGES ON *.* TO 'root'@'127.0.0.1';
FLUSH PRIVILEGES;

Voilà, now connect from Node and everything works:瞧,现在从 Node 连接,一切正常:

const mariadb = require('mariadb'); // or require('mysql');

const pool = mariadb.createPool({
    host: 'localhost',  // or host: '127.0.0.1'
    user: 'root',
    password: 'password',
    database: 'mydatabase',  // don't forget the database
    port: 3306,
    connectionLimit: 5
});

References:参考:

Here's where I got the solution from, read for more info 这是我从中获得解决方案的地方,请阅读以获取更多信息

I have faced this issue by giving the full user name in the user section when I changed the 'root'@'localhost' to 'root' It is working fine now.当我将 'root'@'localhost' 更改为 'root' 时,我通过在用户部分提供完整的用户名遇到了这个问题它现在工作正常。

var mysql = require('mysql');

 var con = mysql.createConnection({
  host: hostname,
  user: "root",
  password: "rootPassword"
 });

 con.connect(function(err) {
  if (err) throw err;
  console.log("Connected!");
 });

I had the same error from nodejs script, so i removed password parameter and now it magically works fine我从 nodejs 脚本中遇到了同样的错误,所以我删除了密码参数,现在它神奇地工作正常

var mysql = require('mysql');
var connection = mysql.createConnection({
    host: 'localhost',
    user: 'root'
});

Add skip-grant-tables in my.ini (this file is available in default installation path of mysql)my.ini中添加skip-grant-tables (这个文件在mysql的默认安装路径下)

[mysqld] [mysqld]

skip-grant-tables跳过授予表

port=3306端口=3306

对我来说,问题在于 SQL 连接对象pass: 'mypassword'而不是password: 'mypassword'

Mostly the issue will be with the way the password entered is interpreted by MySQL server.主要问题在于 MySQL 服务器解释输入密码的方式。 Please follow the below link.请点击以下链接。 It should resolve the issue.它应该可以解决问题。 MySQL 8.0 - Client does not support authentication protocol requested by server; MySQL 8.0 - 客户端不支持服务器请求的认证协议; consider upgrading MySQL client 考虑升级 MySQL 客户端

If you are connecting to an external server from localhost, you may need to add your gateway router address to MySQL's "Allowable Hosts" box.如果您从 localhost 连接到外部服务器,您可能需要将网关路由器地址添加到 MySQL 的“允许的主机”框中。

MySQL 允许的主机

This address can be found after the @ sign in the error message:这个地址可以在错误信息中@符号后找到:

Access denied for user 'your_username'@'blah.blah.blah.yourisp.com'

Most of the time this things happen due to the misconfigurations in mySQL on your device .大多数情况下,由于您设备上的 mySQL 配置错误,会发生这种情况。 I had this problem myself .我自己也有这个问题。 I have solved the problem using the link below .我已经使用下面的链接解决了这个问题。

ERROR 1044 (42000): Access denied for user ''@'localhost' to database 'db' 错误 1044 (42000): 拒绝用户 ''@'localhost' 访问数据库 'db'

Best Solution to resolve this problem:解决此问题的最佳解决方案:

You got this Error : ER_NOT_SUPPORTED_AUTH_MODE this is error is mentioning when you install sql server you selected"strong authentication", but you set a weak password.您收到此错误:ER_NOT_SUPPORTED_AUTH_MODE 这是在安装 sql server 时提到的错误,您选择了“强身份验证”,但您设置了弱密码。 You need to reset strong password or need to choose legacy authentication method.您需要重置强密码或需要选择旧的身份验证方法。

Follow these steps to choose legacy authentication method...请按照以下步骤选择旧式身份验证方法...

You installed mysql server using "mysql installer"您使用“mysql 安装程序”安装了 mysql 服务器

  1. Open "MySQL Installer".打开“MySQL 安装程序”。

  2. Click "Reconfigure" MySQL server under Quick Action.单击快速操作下的“重新配置”MySQL 服务器。

  3. Click next to maintain current configurations under "High Availability".单击下一步以在“高可用性”下维护当前配置。

  4. Click next to maintain current configurations under "Type and Networking"单击下一步以维护“类型和网络”下的当前配置

  5. Select radio button "Use Legacy Authentication Method" under "Authentication Method" and click next.选择“身份验证方法”下的单选按钮“使用传统身份验证方法”,然后单击“下一步”。

  6. Enter root account password and click on check.输入root帐户密码,然后单击检查。 Wait a while for verification of password and click next.等待一段时间验证密码,然后单击下一步。

  7. Click next to apply configurations and restart the database server.单击下一步以应用配置并重新启动数据库服务器。

Now run code:现在运行代码:

var mysql = require('mysql');
var connection = mysql.createConnection({
host: 'localhost',
user: 'root',
password: 'password'

)}; )};

Password field should be replaced with root password.密码字段应替换为 root 密码。

Login into your mysql using mysql -u root -p password使用mysql -u root -p password登录到你的 mysql

Create new user z (MySQL console)创建新用户 z(MySQL 控制台)

CREATE USER 'z'@'localhost' IDENTIFIED BY '';
GRANT ALL PRIVILEGES ON * . * TO 'z'@'localhost';

Node.js script Node.js 脚本

var mysql = require('mysql');

var con = mysql.createConnection({
    host: "localhost",
    user: "z",
    password: ""
});

con.connect(function(err) {

    if (err) throw err;
    console.log("Connected!");

    con.query("use mysql;", function(err, result) {
        if (err) throw err;
        console.log(result);
    });

    con.query("select * from user limit 1;", function(err, result) {
        if (err) throw err;
        console.log(result);
    });

});

您需要确保您使用的用户名与您在主机名下用于连接的 IP 地址相匹配。

I was facing same error on mac, however whenever I run same code on windows machine it was working absolutely good, without any error.我在mac上遇到了同样的错误,但是每当我在windows机器上运行相同的代码时,它工作得非常好,没有任何错误。 After spending 2 days I found solution.花了2天后,我找到了解决方案。

Below are the steps I followed.以下是我遵循的步骤。

  1. to your project folder in terminal and run "sudo su -" command到终端中的项目文件夹并运行“sudo su -”命令

eg Avi-MBP:projectDirectory avisurya$ sudo su -例如 Avi-MBP:projectDirectory avisurya$ sudo su -

  1. it will as password eg Password: enter your mac user password它将作为密码,例如密码:输入您的mac用户密码

  2. Now you will be in root eg Avi-MBP:~ root#现在您将在 root 中,例如 Avi-MBP:~ root#

  3. now again go to project directory eg Avi-MBP:~ root# cd /Users/avisurya/projectDirectory现在再次进入项目目录,例如 Avi-MBP:~ root# cd /Users/avisurya/projectDirectory

  4. now start node application eg in my case "node server.js"现在启动节点应用程序,例如在我的例子中是“node server.js”

I have solved this by adding socket path to connection configuration.我通过在连接配置中添加套接字路径解决了这个问题。 For more details you can see here有关更多详细信息,您可以在此处查看

I had the same problem today, that's what I did.我今天也遇到了同样的问题,我就是这么做的。 You might not need to choose a different password, just make sure you have the right password in your js file您可能不需要选择其他密码,只需确保您的 js 文件中有正确的密码即可

  • go to your mysql bash by:通过以下方式转到您的mysql bash:
$ sudo mysql
  • change the password of the root user by:通过以下方式更改root用户的密码:
mysql> ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'your-chosen-password';
  • exit the mysql by Ctrl+DCtrl+D退出mysql
  • make sure you have the same password in your js code确保您在 js 代码中使用相同的密码
  • in the bash:在 bash 中:
$ mysql -u root -p
  • enter the password you chose you should be able to see the welcome message of mysql输入你选择的密码应该可以看到mysql的欢迎信息

  • exit and in the bash run the node connection code again:退出并在 bash 中再次运行节点连接代码:

$ node ./database/actions/db-connect.js

make sure you use the right password确保您使用正确的密码

make sure that there is no error in your configuration files, I struggled to get this sorted as well only to find out that all along I had been attempting to connect with wrong connection parameters.. the bug code was:确保您的配置文件中没有错误,我也努力对此进行排序,只是发现我一直在尝试使用错误的连接参数进行连接..错误代码是:

require('dotenv').config()
    let  config= {
        client: 'mysql2',
        connection: {
            host:process.env.MYSQL_HOST,
            user:process.env.MYSQL_USER,
            database:process.env.MYSQL_PASS, // here
            password:process.env.MYSQL_DB,   //here
            multipleStatements: true
        }
    }

module.exports= require('knex')(config);

the correction:更正:

require('dotenv').config()
    let  config= {
        client: 'mysql2',
        connection: {
            host:process.env.MYSQL_HOST,
            user:process.env.MYSQL_USER,
            password:process.env.MYSQL_PASS, // here
            database:process.env.MYSQL_DB,   //here
            multipleStatements: true
        }
    }

module.exports= require('knex')(config)

In my case, the connection was successful when seeding the database, but not when starting the server.就我而言,在为数据库播种时连接成功,但在启动服务器时却没有。 Strange!奇怪的!

The problem was that the .env file was not found by the server because the parent directory was different than the parent directory of the seed process.问题是服务器找不到 .env 文件,因为父目录与种子进程的父目录不同。

require('dotenv').config({path: "../../.env"});

I solved my problem by using a library called 'app-root-path'我通过使用名为“app-root-path”的库解决了我的问题

const appRoot = require('app-root-path');
require('dotenv').config({path: appRoot + path.sep + ".env"});

In my case, the password I was using had "#" in it and this prevented dotenv package to read the whole password from .env file.就我而言,我使用的密码中有“#”,这阻止了 dotenv 包从 .env 文件中读取整个密码。 Surrounding the password with double quotes ("") solved the problem.用双引号 ("") 将密码括起来解决了这个问题。

var mysql = require('mysql')    
    var con = mysql.createConnection({
        host: '127.0.0.1',
        user: 'root',
        password: '',
        database: 'hospital_manager',
        });

    con.connect(function (err) {
        if (err) throw err;
        console.log("Connected!");
    });

I have the same issue, try to check if you can log in, open your cmd terminal, and type cd C:\Program Files\MySQL\MySQL Server 8.0\bin then type: MySQL -u root -p, then enter your password, On my own, I find that MySQL is still using my old password, and I tried login in with a new password that is not recognized我有同样的问题,尝试检查是否可以登录,打开你的cmd终端,输入cd C:\Program Files\MySQL\MySQL Server 8.0\bin 然后输入:MySQL -u root -p,然后输入你的密码,我自己发现MySQL还在用我的旧密码,我尝试用新密码登录不被识别

The code to connect to mysql using dotenv in nodejs在nodejs中使用dotenv连接mysql的代码

          .env file

          NODE_ENV=DEVELOPMENT
          DB_HOST=localhost
          DB_USER=root
          DB_PASSWORD=password
          DB_NAME=test

              
           db.js file


           const util = require("util");
           const mysql = require("mysql2");

           const pool = mysql.createPool({
           host: process.env.DB_HOST,
           user: process.env.DB_USER,
           password: process.env.DB_PASSWORD,
           database : process.env.DB_NAME,
           uri: process.env.DB,
           waitForConnections: true,
           connectionLimit: 10,
           queueLimit: 2,
            });

卸载mysql,并卸载mysql相关服务(如mysqld.exe xampp)。然后,重新安装mysql。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 ER_ACCESS_DENIED_ERROR:nodeJS 上的访问被拒绝 - ER_ACCESS_DENIED_ERROR: Access denied on nodeJS ER_ACCESS_DENIED_ERROR CloudSQL - ER_ACCESS_DENIED_ERROR CloudSQL 用户 'admin'@'localhost' 的访问被拒绝(使用密码:YES)sql 异常 - Access denied for user 'admin'@'localhost' (using password: YES) sql exception sqlalchemy.exc.OperationalError:(MySQLdb._exceptions.OperationalError)(1045,“用户&#39;root&#39;@&#39;localhost&#39;的访问被拒绝(使用密码:NO)”) - sqlalchemy.exc.OperationalError: (MySQLdb._exceptions.OperationalError) (1045, “Access denied for user 'root'@'localhost' (using password: NO)”) 如何修复&#39;拒绝访问用户&#39;&#39;root \\&#39;@ \\&#39;localhost \\&#39;,错误号1045 - How to fix 'Access Denied for user \'root\'@\'localhost\', error number 1045 ER_ACCESS_DENIED_NO_PASSWORD_ERROR 表示混淆 - ER_ACCESS_DENIED_NO_PASSWORD_ERROR meaning confusion 错误:用户&#39;postgres&#39;@&#39;localhost&#39;的访问被拒绝(命令行) - ERROR: Access denied for user 'postgres'@'localhost' (Command Line) NodeJS Bin 访问被拒绝 - NodeJS Bin Access is denied 管理员页面在orgfree访问中不起作用,拒绝用户&#39;root&#39;@&#39;localhost&#39;吗? - Admin page doesn't work in orgfree Access denied for user 'root'@'localhost'? “访问被拒绝” JavaScript错误 - 'Access is denied' Javascript error
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM