简体   繁体   English

ConnectionError:无法连接到{数据库服务器}-无法连接(顺序)

[英]ConnectionError: Failed to connect to {database server} - Could not connect (sequence)

I'm running this node.js application on a shared hosting site (cPanel) and run into this connection problem to the RDS SQL Server and I'm not sure what I can do to get more information on the problem so I can fix it or how to fix it. 我在共享托管站点(cPanel)上运行此node.js应用程序,并遇到了与RDS SQL Server的连接问题,我不确定该怎么做以获取有关此问题的更多信息,以便对其进行修复。或如何解决。

I can successfully connect to the SQL Server using SMSS, furthermore, using the SAME node.js code I can connect to the SQL Server on my main desktop. 我可以使用SMSS成功连接到SQL Server,此外,可以使用SAME node.js代码连接到主桌面上的SQL Server。 This connection problem only occurs when running the same code on cPanel. 仅当在cPanel上运行相同的代码时,才会出现此连接问题。

I have allowed all IP address access (All traffic inc TCP/UDP)through the RDS VPC security group: 0.0.0.0/0 我已允许通过RDS VPC安全组的所有IP地址访问(所有流量,包括TCP / UDP):0.0.0.0/0

I'm just confused as it works on my desktop but does not work on the hosting site, as the security group allows all access from all IP's. 我只是感到困惑,因为它可以在我的桌面上工作,但不能在托管站点上工作,因为安全组允许所有IP的所有访问。 Is possible for the hosting site to prevent connections to databases and is something I should look into? 托管站点是否可以阻止与数据库的连接,我应该研究一下吗?

ERROR: 错误:

ConnectionError: Failed to connect to - Could not connect (sequence) ConnectionError:无法连接-无法连接(顺序)

Failed to connect to - Could not connect (sequence) 连接失败-无法连接(顺序)
code: 'ESOCKET' 代码:“ ESOCKET”
name: 'ConnectionError' 名称:“ ConnectionError”

Code used to connect to the database: 用于连接数据库的代码:

// config for your database
var config = {

    user: ...,
    password: ...,
    server: ..., 
    database: ...,
    port: 1521,
    dialect: "mssql",
    dialectOptions: {
        instanceName: "SQLEXPRESS"
    }

};

// connect to your database

sql.connect(config, function (err) {

    if (err) console.log(err);

});`

Found the answer. 找到了答案。 Brad was right, this is a cPanel specific problem. 布拉德说得对,这是cPanel的特定问题。

As I'm using shared hosting on cPanel (through namecheap), connecting to a SQL SERVER or any remote database instance is not permitted for security reasons. 由于我在cPanel上使用共享主机(通过namecheap),出于安全原因,不允许连接到SQL SERVER或任何远程数据库实例。

If anyone wishes to connect to a remote database using the same methods, ensure you do not have shared hosting. 如果有人希望使用相同的方法连接到远程数据库,请确保您没有共享主机。 :( :(

暂无
暂无

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

相关问题 ConnectionError [SequelizeConnectionError]:无法连接到:1433 - 无法连接(序列)本地机器 window 10 - ConnectionError [SequelizeConnectionError]: Failed to connect to :1433 - Could not connect (sequence) local machine window 10 使用 sequelize-automate 出现错误“ConnectionError [SequelizeConnectionError]:无法连接到 localhost:1443 - 无法连接(序列)” - Error "ConnectionError [SequelizeConnectionError]: Failed to connect to localhost:1443 - Could not connect (sequence)" using sequelize-automate ConnectionError:无法连接到MyServer:1433 - ConnectionError: Failed to connect to MyServer:1433 ConnectionError:无法在nodeJS中的mssql中进行连接 - ConnectionError: Failed to connect in mssql in nodeJS ConnectionError:无法连接到 <SQLServerDB> -连接EACCES <SQLServerDB> - ConnectionError: Failed to connect to <SQLServerDB> - connect EACCES <SQLServerDB> [连接错误:15000 毫秒内无法连接到 IP] - [ConnectionError: Failed to connect to IP in 15000ms] 如何解决“ConnectionError:无法连接到<server> :<port> 在 15000 毫秒内”错误? - How do I fix the "ConnectionError: failed to connect to <server>:<port> in 15000ms" error? 加载资源失败:无法连接到服务器 - Failed to load resource: Could not connect to the server ConnectionError:无法连接到localhost:15000ms内未定义 - ConnectionError: Failed to connect to localhost:undefined in 15000ms Node.js MSSQL tedius ConnectionError: Failed to connect to localhost:1433 - connect ECONNREFUSED - Node.js MSSQL tedius ConnectionError: Failed to connect to localhost:1433 - connect ECONNREFUSED
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM