我在我的Windows机器上安装了一个mySQL服务器,我还安装了WSL,这样我就可以在我的Windows机器上使用linux的所有优点。我分配了一个JS,其中包含与数据库的连接,所以我运行的mySQL服务器一切正常,但是当我使用node index.js从WSL启动JS并尝试连接到数据库时,它会引发一个sql错误。
Server running on port 8080 , http://localhost:8080
/mnt/c/Users/ngkil/Documents/VSCode/WebDevAssignment2022/Backend/index.js:43
我在亚马逊网络服务和MySQL数据库上有一个实例在工作。我能够通过本地机器上的工作台连接到该实例。但是,我无法通过node js代码连接到数据库。以下是代码片段:
var express = require("express");
var mysql = require('mysql');
var connection = mysql.createConnection({
host : 'ec2-52-33-41-xxx.us-west-2.compute.amazonaws.com',
port : 3
我有一个节点容器,我正在尝试连接到本地托管的mysql (外部容器)。我尝试过"localhost“、"mysql”,现在实例容器的ip地址正在运行在config.js中的172.17.x.x:3306上(使用config.js中的端口检查\ grep网关)。想法?
Mysql绑定到0.0.0.0
错误:
Unable to connect to the database: { SequelizeConnectionRefusedError: connect ECONNREFUSED 127.0.0.1:3306
at Promise.tap.then.catch.er
我正在运行一个以mysql作为我的数据库的节点应用程序(也使用sequelize作为ORM)。每当我使用“节点”命令运行"app.js“文件时,就会得到一个错误:
{错误:连接ECONNREFUSED 127.0.0.1:3306代码:“ECONNREFUSED”,errno:“ECONNREFUSED”,syscall:“connect”,地址:'127.0.0.1',端口: 3306,致命: true }
my code in the app.js file:
var mysql = require("mysql");
var connecti
我正试着在我的windows机器上使用valet for windows来设置一个本地开发环境。它适用于laravel和标准应用程序,但不适用于安装wordpress。它返回一个致命错误。
我正在运行php版本7.2.22,laravel valet for windows 2.1.1,mysql版本8.0和wordpress版本5.2.3。我正在尝试脱离MAMP设置,因此已经完成了为windows设置贴身服务的过程。
我已经检查了我为本地数据库提供的凭据是否正确,mysql正在使用端口3306,端口80是空闲的,可供代客使用。
在wp-config.php文件中提供了本地数据库的详细信息(在
我正在使用带有外部mysql数据库的node js app。它可以在本地主机和其他主机上正常工作,但是在openshift上我得到了这个错误: connect ECONNREFUSED。
var mysql = require('mysql');
var dbConfig = {
host : 'external.mysql.com',
port : '3306',
user : 'user',
pas
我有下面的代码,我正在尝试运行它。我已作出相应的评论,以提及我所做的一切努力。
// File saved as app.js
var mysql = require('mysql');
var connection = mysql.createConnection({
host:'localhost', //even tried with 127.0.0.1
port:3306, //confirmed port by looking into /etc/mysql/my.cnf has [client] port =
无法将sailsJs dockerimage连接到mongodb。我在连接在本地机器上运行的mongodb时遇到了问题,而不是作为mongo镜像。
mongodb在本地主机上运行:27017
error: Error: Failed to connect to MongoDB. Are you sure your configured Mongo instance is running?
Error details: {
Error: connect ECONNREFUSED 127.0 .0 .1: 27017
at Object.exports._errnoExc
我曾尝试将NodeJS连接到Windows10上的mysql,但一直失败。下面是来自的代码
var mysql = require('mysql');
var con = mysql.createConnection({
host: "localhost",
user: "yourusername",
password: "yourpassword"
});
con.connect(function(err) {
if (err) throw err;
console.log("Connected!
当我启动我的node.js应用程序时,我得到了这个错误: SequelizeConnectionRefusedError: connect ECONNREFUSED 127.0.0.1:3306 我在做什么: - create a user:
CREATE USER 'main'@'localhost' IDENTIFIED BY 'myPass';
- give this user all privileges
GRANT ALL PRIVILEGES ON *.* TO 'main'@'localhost
我试图通过node.js连接到MySQL服务器,但得到了ECONNREFUSED 127.0.0.1:3306。我在我的Windows10桌面上运行node,而MySQL在远程Linux服务器上运行。我拥有MySQL的管理员访问权限,但无法通过node访问它。 我的代码: var conn = mysql.createConnection({
hostname: "My mySQL server",
port: 3306,
user: "adminid",
password: "adminpassword"
});
con
我试图运行expo start或yarn start,但控制台抛出了一个错误。在wsl1上它工作得很好,它显示了二维码。然而,我不得不切换到wsl2来为我的本地服务器设置mysql,而现在expo没有启动。此外,有时会显示二维码,但当我尝试在设备中打开应用程序时,同样的错误也会出现。
Developer tools running on http://localhost:19002
Could not get status from Metro bundler. connect ECONNREFUSED 127.0.0.1:19001
Connecting to Metro bundler f
我试图连接我的mysql数据库,但我没有得到错误:错误:连接ECONNREFUSED 127.0.0.1:8889
我的代码:
var express = require("express");
var app = express();
var mysql = require("mysql");
var bodyParser = require("body-parser");
app.use(bodyParser.json({type:'application/json'}));
app.use(bodyParser.urle