简体   繁体   中英

How to connect to my PostgreSQL database from RDP?

I have a discord.py bot and I host it on Google Cloud RDP (windows). I was working and testing PostgreSQL database on my local computer and it was working like charm now when I tried to use the same code and same connection method on my RDP, I got an error.

在此处输入图像描述

This is how I connect to database on my local pc:

在此处输入图像描述

How do I connect it with RDP now? Do I need to make any changes to the database like whitelisting the IP and if so How do I do it? Thanks

If the database is running on your local computer inside your firewall/router, then it cannot be reached from the Inte.net. If you control your router, you can try forwarding port 5432 on your public IP to port 5432 on your Windows computer. However, it might be better if you just moved the Postgres instance to your cloud instance.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM