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

      <legend id='MyOKp'><style id='MyOKp'><dir id='MyOKp'><q id='MyOKp'></q></dir></style></legend>

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

      1. <tfoot id='MyOKp'></tfoot>

        • <bdo id='MyOKp'></bdo><ul id='MyOKp'></ul>
      2. 连接 ECONNREFUSED - 节点 js , sql

        时间:2023-06-03
          <bdo id='9fqT8'></bdo><ul id='9fqT8'></ul>

                <tbody id='9fqT8'></tbody>

              <small id='9fqT8'></small><noframes id='9fqT8'>

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

                  本文介绍了连接 ECONNREFUSED - 节点 js , sql的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我在 js 文件中有下一段代码:

                  var mysql = require('mysql');
                  var TEST_DATABASE = 'nodejs_mysql_test';
                  var TEST_TABLE = 'test';
                  var client = mysql.createClient({
                    user: 'root',
                    password: 'root',
                  });
                  
                  client.query('CREATE DATABASE '+TEST_DATABASE, function(err) {
                    if (err && err.number != mysql.ERROR_DB_CREATE_EXISTS) {
                      throw err;
                    }
                  });
                  

                  但我收到此错误:

                  node.js:201
                          throw e; // process.nextTick error, or 'error' event on first tick
                            ^
                  Error: connect ECONNREFUSED
                      at errnoException (net.js:632:11)
                      at Object.afterConnect [as oncomplete] (net.js:623:18)
                  

                  据我所知,这是一个连接问题 - 但我该如何解决?

                  As I understand it, this is a connection problem - but how do I solve it?

                  (我在 Windows 7 上工作)

                  ( I'm working on windows 7)

                  谢谢!!

                  推荐答案

                  我知道两种解决方法:

                  1. mysql.conf中,注释skip-networking.

                  尝试像这样设置套接字:

                  Try to set the socket like this:

                  var client = mysql.createClient({
                  user: uuuu,
                  password: pppp,
                  host: '127.0.0.1',
                  port: '3306',
                  _socket: '/var/run/mysqld/mysqld.sock',});
                  

                  这篇关于连接 ECONNREFUSED - 节点 js , sql的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:MySQL 表名中的特殊字符 下一篇:Mysql:如何选择具有特定值的组?

                  相关文章

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

                • <tfoot id='mEmcr'></tfoot>

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