我有一个NodeJs应用程序和MySQL数据库。我在google中部署了nodejs应用程序,并在google cloud中创建了google cloud数据库,并连接到nodejs应用程序,我可以成功地部署应用程序,但应用程序无法连接到云MySQL。
但是,当我试图从本地mysql工作台连接云mysql时,它成功地连接到数据库。我还可以从本地nodejs应用程序连接云mysql数据库。
但我无法从已部署的nodejs应用程序连接到云mysql db。
误差 Database is not connectedError: connect ETIMEDOUT
Db.js
var mysql =
我想不清楚sqlalchemy是如何工作的,我尝试从本地计算机连接到运行在云服务器上的postgresql:
db = create_engine('postgresql://ubuntu@172.23.160.212:5432/dbname')
但这会导致错误。
Is the server running on host "172.23.160.212" and accepting
TCP/IP connections on port 5432?
我已经检查了端口和主机也存在。
我认为我应该首先使用ssh连接到主机:
with SSHTunnelFor
我有一个弹簧引导应用程序。我想通过jedisconnectionfactory连接到Redis云服务器,但我做不到。实际上,当我使用本地Redis服务器时,它可以工作。
我编写的Redis配置如下所示。
@Configuration
public class RedisConfig {
@Bean
public JedisConnectionFactory connectionFactory() {
RedisStandaloneConfiguration configuration = new RedisStandaloneConfiguration();