Showing posts with label postgresql. Show all posts
Showing posts with label postgresql. Show all posts
Tuesday, December 6, 2016
Postgresql different syntaxes
Postgresql different syntaxes
As I am currently working on a project involving PostgreSql, I came to learn some very important commands that I use. heres a list of those commands.
Go to link download
Labels:
different,
postgresql,
syntaxes
Wednesday, September 14, 2016
When you cant log into Postgresql from Web Interface Adminer etc
When you cant log into Postgresql from Web Interface Adminer etc
I ran into this problem earlier this week and left it until today, when I needed it work at all cost. Turns out it was a simple issue with the configuration file. Heres the process.
First of all, open the file /etc/postgresql/9.1/main/pg_hba.conf
Find the line : "local" is for Unix domain socket connections only
Below that line there is a line like this: local all all md5
Just change the last value to: peer
So the line now looks like: local all all peer
Now save the file (you need to be root)
Then restart the Postgresql process using the command: sudo service postgresql restart
Done.
First of all, open the file /etc/postgresql/9.1/main/pg_hba.conf
Find the line : "local" is for Unix domain socket connections only
Below that line there is a line like this: local all all md5
Just change the last value to: peer
So the line now looks like: local all all peer
Now save the file (you need to be root)
Then restart the Postgresql process using the command: sudo service postgresql restart
Done.
Go to link download
Tuesday, August 16, 2016
Connecting via Remote host using postgresql
Connecting via Remote host using postgresql
When the instance of postgres is inside vm and you are on the host machine with some stack such as Node, the scenario becomes as if connecting from a remote host. To make it possible, we have to make postgres listen to remote (all) hosts and also specify the IP of that host.
1. To add the ip to the allowed host list, edit /etc/postgresql/9.1/main/pg_hba.conf and add the lines
host all all 192.168.0.1/24 md5
where 192.168.0.1 is the IP of the host you want to connect from.
2. And to enable listening from remote hosts, edit the file /etc/postgresql/9.1/main/postgresql.conf and add the following line
listen_addresses = *
Credits http://www.thegeekstuff.com/2014/02/enable-remote-postgresql-connection/
1. To add the ip to the allowed host list, edit /etc/postgresql/9.1/main/pg_hba.conf and add the lines
host all all 192.168.0.1/24 md5
where 192.168.0.1 is the IP of the host you want to connect from.
2. And to enable listening from remote hosts, edit the file /etc/postgresql/9.1/main/postgresql.conf and add the following line
listen_addresses = *
Credits http://www.thegeekstuff.com/2014/02/enable-remote-postgresql-connection/
Go to link download
Labels:
connecting,
host,
postgresql,
remote,
using,
via
Subscribe to:
Posts (Atom)