Tableau Online Can't Connect to PostgreSQL - postgresql

I'm new to postgres and computer networks, so I'm having a hard time with this problem.
I installed postgres via Homebrew on my mac recently. Up to now I could create a user on postgres and use psql as well as connect with pgAdmin.
I'm now trying to connect PostgreSQL with Tableau Online to deliver some analysis but it keep giving me this error Tableau Online screenshot.
Does anyone know what it might be?
I already changed postgresql.conf line:
#listen_addresses = 'localhost'
to
#listen_addresses = '*'
and added the following line on pg_hba.conf:
host all all all md5
Thank you in advance :)

Tableau Online is a cloud service. Machine where Tableau is running is not your mac, but actually some box somewhere in tableau cloud. By stating localhost you tell tableau to connect to postgres to that box. Which is not correct in this case. In order to connect to your postgresql you need to tell to Tableau Online the actual public ip address where postgresql server is.
So you need to figure out your postgresql public ip address e.g google "what is my ip"... there is few services available
Then give that address to Tableau public. Next thing is the firewall etc settings on your mac. I suggest you do some study what is safe and what not. But in general you should allow incoming connections from Tableau Online IP address.
Pls. note that your mac public ip will change when you use different network(wifi) and even time to time on same network. Normally servers like postgresql in production environment have static ip address.

Related

how to connect with a live database in tableau using ssh tunneling?

I have a PostgreSQL database hosted in private network. i have bastion id, username ,database credentials. how can I connect the database with tableau using ssh key? so far i did not find any viable solution for this problem. I need a solution where tableau with get connected with the database and get live data.
If Tableau doesn't have integrated tools to create the tunnel (and as far as I know it doesn't) then you can create a tunnel yourself using ssh or putty or some python module, for example. Then tell Tableau Desktop to connect to the database at the address of the local end of the tunnel, likely 127.0.0.1:5432.

How to connect to RDS Postgres instance with psql

I am brand new to RDS and have only used postgres through Rails and/or Heroku for the most part, so not that deep into database management. All I am trying to do is verify I can connect to the RDS instance I just created on AWS, but it is hanging, psql reporting this after hanging for about 30 seconds or a few minutes I guess:
$ psql postgresql://myuser:mypass#myawshost.rds.amazonaws.com:5432/my-db-name
psql: error: could not connect to server: Operation timed out
Is the server running on host "myawshost.rds.amazonaws.com" (<the ip address>) and accepting
TCP/IP connections on port 5432?
How do I connect to my AWS RDS instance from localhost?
I am sure I have the correct username and password.
I am sure the host is correct.
I am not sure if I should be including the port.
I am not sure if I am supposed to put a DB name, as under the "Configuration" tab in the RDS admin console for my database, it says DB instance ID: my-db-name, Engine version: 13.3, DB name: -, I am not sure if that - is my actual postgres db name or my-db-name is....
I tried this with the db name and it still hangs:
$ psql postgresql://myuser:mypass#myawshost.rds.amazonaws.com:5432/-
I edited the security group which is linked under the VPC security groups section of the Connectivity & security tab of https://console.aws.amazon.com/rds/home, so it allows all incoming connections. I also tried limiting to just my IP address as incoming connections.
Any help would be appreciated, thanks. Not sure why it would just be hanging. I have used a local version of postgres just fine, but connecting to postgres RDS is not working.
Underneath the Connectivity and Security > Security section I just noticed it says Public accessibility: No. Must I enable something else? There is also one VPC, one Subnet group, and several Subnets, which I don't know too much about, must I do something there?
Finally, "status" says Available with a green light, so things seem fine there.
I found a useful link in AWS knowledge center, I hope this will help you.
Btw if your RDS is deployed in a public subnet, yes you need to enable if you want to access RDS over the internet.
My DB instance is in a public subnet, and I can't connect to it over the internet from my local computer
This issue can occur when the Publicly Accessible property of the DB instance is set to No. To check whether a DB instance is publicly accessible, you can use the Amazon RDS Console or the AWS CLI.
To change the Publicly Accessible property of the Amazon RDS instance to Yes:
Verify that your VPC has an internet gateway attached to it. Make sure that the inbound rules for the security group allow connections.
Open the Amazon RDS console.
Choose Databases from the navigation pane, and then select the DB instance.
Choose Modify.
Under Connectivity, extend the Additional configuration section, and then choose Publicly accessible.
Choose Continue.
Choose Modify DB Instance.
Note: You don't need to choose Apply Immediately. For more information about how Apply Immediately can affect downtime, see Using the Apply Immediately parameter.
https://aws.amazon.com/premiumsupport/knowledge-center/rds-connectivity-instance-subnet-vpc/

Remote Database Connection Setup in Netbeans

I'm totally junior in this area :)
I have JAVA version 7 on my PC.
I want to connect my PostgreSQL database to NetBeans.
Based on my search I found that I should get JDBC driver. so I downloaded JDBC41 Postgresql Driver, Version 9.3-1100 jar files from here.
then based on what I found for connection remote Mysql, did similar changes to connect to my PostgreSQL database.
As you can see in the image, connection couldn't established.
Based on what my host says, I added my IP address to "Remote PostgreSQL Database Access" page of my host.
I'm not sure my host name is correct. I used Dedicated IP Address of my site.
Any suggestion would be appreciated. Thanks
My fault was entering wrong user name and pass instead of using user name and password of database :(

Connecting to localhost Neo4j database from remote device (iPhone)

Currently, my Neo4j database uses the address http://127.0.0.1:7474.
I have changed the file neo4j-server.properties so it now reads org.neo4j.server.webserver.address=0.0.0.0 as it says to uncomment this line to allow remote access.
I have also tried org.neo4j.server.webserver.address=127.0.0.1 but when trying to access http://127.0.0.1:7474 on my iPhone I cannot connect to the server.
Has anyone had any experience trying to do this?
Thanks as always
You should change the localhost IP to the address of your computer running Neo4J.

How can I configure PostgreSQL to use Windows Authentication?

I am trying to setup PostgreSQL and allow only certain Windows users to access the data from the database. Setting up Windows Authentication is Quite easy with MS SQL, but I can't figure out how to set it up in PostgreSQL.
I have gone through the documentation at http://www.postgresql.org/docs/current/static/auth-methods.html
and edited the pg_hba file. But after doing so, the PostgreSQL service fails to start.
Is the Postgresql server running on Windows as well as the clients then you might test with this to see if this works:
host all all 0.0.0.0/0 sspi
Magnus Hagander, a Postgresql developer, elaborates on this:
"All users connecting from the local machine, your domain, or a trusted domain will be automatically authenticated using the SSPI configured authentication (you can enable/disable things like NTLMv2 or LM using Group Policy - it's a Windows configuration, not a PostgreSQL one). You still need to create the login role in PostgreSQL, but that's it. Note that the domain is not verified at all, only the username. So the user Administrator in your primary and a trusted domain will be considered the same user if they try to connect to PostgreSQL. Note that this method is not compatible with Unix clients."
If you mix Unix-Windows then you have to resort to kerberos using GSSAPI which means you have to do some configuration. This article on deploying Pg in Windows environments may perhaps lead you in the right path.
If anyone else encouters this like I did so starting from 9.5 you wil need to add an optional parameter both to the ipv4 and ipv6 in order for this to work
include_realm=0
so the whole thing will look like
host all your_username 127.0.0.1/32 sspi include_realm=0