Recently, I have installed PostgreSQL 9.3 on my windows 7 64 bit PC but today I have formatted my PC. Now again I tried to install PostgreSQL 9.3 but after installation when I tried to connect it throws error See below screenshot :-
My pg_hba.conf is shown below :
I have also saw Postgres password authentication fails but nothing helps.
I am new to PostgreSQL,please help me on this.
Finally I found the solution hope this will help to other users if they are facing the same problem :-
I have to edit pg_hba.conf file which is located in "C:\Program Files\PostgreSQL\9.3\data". In that file I have to make method md5 to trust as #Craig Ringer said. So the line will look like host all postgres 127.0.0.1/32 trust.
Then to restart the PostgreSQL on windows - Go to start > run > services.msc then restart the service.
Then open pg Admin create new server enter all the required details and save it. That's it !!
Related
I am trying to log in my postgresql.After researching I have solved a slew of many issues from a weird python dependency issue to creating sudoers with names and passwords as db to removing and reinstalling postgresql, still i cannot log in as the default user "postgres".
A simple error but i cannot find a straight forward answer.
Is the server running locally and accepting
connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
NOTE:
My first installation,postgresql 11, I changed pg_hba.conf from peer to md5 but refused to login.
I removed postgresql 11 using many commands to purge it out of my system but am shocked anytime i do a locate postgress or locate psql i find a list of postgresql files. The most weird is running *apt-get remove --auto-remove postgresql* and sudo apt --purge remove postgresql -y then running service postgresql start only for it to start!Cannot wrap my head around this after trying several times, i thought it would be removed completely?!.
Though I can locate pg_hba.conf, the actual file is totally nonexitent when I ls the containing directory!!! Are there many /etc/ folders, seems am looking at the wrong /etc/ ?
I also faced this problem - You try this method, it's work for me.
If You using Linux then do according your server path .
Window Path ->
Go To -> C:\Program Files\PostgreSQL\11\data then Open pg_hba.conf
Find and replace md5 or sha256 to trust
local replication all trust (Change md5 or sha256 to trust)
host replication all trust (Change md5 or sha256 to trust)
Maybe this method helpful for you.
Just updated pgadmin4 to version 4.8 and now it won't accept ssh tunnel password into server, I get the following error message:
Failed to decrypt the SSH tunnel password. Error: 'utf-8' codec can't decode byte 0x8c in position 0: invalid start byte
Is there a way around this, I can't restart the database server at this time.
In latest pgAdmin4 version they have increased the security of saved password by implementing master password feature, I think that is causing this issue, meantime you can rename pgadmin4.db to pgadmin4.db_OLD and restart pgAdmin4.
Note: You have to add the all the servers again.
---------- UPDATE ----------
It has been fixed now https://redmine.postgresql.org/issues/4320 and will be in 4.9.
You can try nightly builds though https://postgresql.org/ftp/pgadmin/pgadmin4/snapshots
This also happened for me moving from 4.8.2 for Ubuntu 18.10 to 4.8.2 for Ubuntu 19.04 (different installs). I was able to resolve this by restarting the postgres server with sudo systemctl restart postgresql
As said Murtuza Z, in https://redmine.postgresql.org/issues/4320, you can get fixed server_manager.py and replace it at (pgAdmin install dir)/web/pgadmin/utils/driver/psycopg2/server_manager.py, then restart the pgadmin server.
You can get server_manager.py:
It is attached in an issue info. < this worked for me.
Get from snapshots provided by Murtuza Z in same directory.
I've just installed Postgressql (9.5.4 vc14_0) and Psycopg2 (2.7.5 py36h74b6da3_0) and I'm trying to use them within my Anaconda environment on Windows 10.
Whenever I run psycopg2.connect("host=localhost user=postgres") in a python interpreter or just psql on the command line I get this error:
could not connect to server: Connection refused (0x0000274D/10061) Is the server running on host "localhost" (127.0.0.1) and accepting TCP/IP connections on port 5432?
I've looked at other Stackoverflow questions regarding this, some answers say to look into a pg_hba.conf file although I haven't be able to find any. Where can I find a pg_hba.conf file for my Postgresql in my Anaconda Environment for Windows? If I have to make one, what should go in it? I haven't seen another SO question that uses the same Postgresql-Anaconda-Windows setup that I'm using.
Also I've looked into services.msc but haven't seen a service regarding postgresql.
I just ran into this error as well. Similar to what you did, I followed the installation page, ran conda install -c anaconda postgresql and received the same error in your post.
I have used postgresql through direct installation before, in osx and as far as I can recall, you could just psql into the database once the installation is complete.
Maybe this isn't the case for anaconda installations. I overcame this by initializing a new database system in a new, empty folder. In my case, I created a new folder in "\AppData\Local\conda\"
-- Initialize the database system
pg_ctl init -D <path_to_your_database_system>
-- Start the database
C:/Users/kerwei/AppData/Local/Continuum/anaconda3/envs/py36/Library/bin/pg_ctl -D <path_to_your_database_system> -l logfile start
NOTE: After playing around with for awhile, I realized that once you exit the conda environment, the database instance gets terminated too - without properly shutting down. As I don't use it for production stuffs, it doesn't really bother me. However, further steps can be taken to include the database booting and shutting down during conda activate or conda deactivate to make it less cumbersome.
I'm using MAMP to set up a magenta installation. But after a fresh install of MAMP, I wanted to set up the db and it's giving me this error:
MySQL said: Documentation
Cannot connect: invalid settings.
phpMyAdmin tried to connect to the MySQL server, and the server rejected the connection. You should check the host, username and password in your configuration and make sure that they correspond to the information given by the administrator of the MySQL server.
I've been researching for over an hour and everything I find doesn't help. I never changed the default password for mysql and I'm able to log in using the command line and -uroot -proot. I also tried changing the password and it didn't make any difference.
OSX 10.11.0
MAMP 3.5.1
PHP 7.0.8
Make sure your PHP version in MAMP is 5.6.10.
I've been having the exact same problem and just switched the PHP prefs from 7.0.8 to 5.6.10, restarted the servers and I can get into phpMyAdmin now.
It was driving my bonkers as well.
I have pre installed postgres , postgres-9.3 and pgadmin on port 5432 and 5433 .
uninstall them then trying to install odoo 9 using http://openies.com/blog/install-openerp-odoo-9-on-ubuntu-server-14-04-lts/
this tutorial .
but when i ttrying to execute command
createuser --createdb --username postgres --no-createrole --no-superuser --pwprompt odoo
then it gives following error :
createuser: could not connect to database postgres: could not connect
to server: No such file or directory Is the server running locally
and accepting connections on Unix domain socket
"/var/run/postgresql/.s.PGSQL.5432"?
sudo netstat -nltp | grep 5432 is not showing any result .
pg_hba.conf
# Database administrative login by Unix domain socket
local all postgres peer
# TYPE DATABASE USER ADDRESS METHOD
# "local" is for Unix domain socket connections only
local all all peer
# IPv4 local connections:
host all all 127.0.0.1/32 md5
# IPv6 local connections:
host all all ::1/128 md5
# Allow replication connections from localhost, by a user with the
# replication privilege.
#local replication postgres peer
#host replication postgres 127.0.0.1/32 md5
#host replication postgres ::1/128 md5
1. Introduction
In this tutorial I will learn you how to install Odoo 9 on Ubuntu 14.04. The script that you will use is based on the code from André Schenkels but has been updated and improved.
2. Downloading the script
The first step is to download my script from GitHub and to add the code in a new .sh file on your Ubuntu machine, wherever you’d like this.
For example right under /home. Open up an Ubuntu terminal and cd to the directory where you’d like to keep the script and then create the file:
sudo wget https://raw.githubusercontent.com/Yenthe666/InstallScript/9.0/odoo_install.sh
If you’re curious about how the whole code looks and works you can find it on my Github account.
Now open up the file and edit the parameters to your liking:
sudo nano odoo_install.sh
There are some things you can configure/change to your likings at the top of the script. You can choose if you wish to install Wkhtmltopdf or not, which version you’d like, where the location is and most importantly what the master admin password is. Tip: always modify this for every Odoo you install!
3. Making the Odoo installation file executable
The next step is to make this file executable. After you’ve made it executable you can execute it and everything will be installed automatically.
do this with the following command:
sudo chmod +x odoo_install.sh
4.Running the script
Now that the code is in your file and the file is executable you simply have to execute it with the following command:
./odoo_install.sh
You will see that the script automatically starts updates, downloads required packages, creates the user, downloads the code from Github, …
Give the script a few minutes to configure and install everything and eventually you will see something like this:
You now have a fully functional Odoo V9 on your system! Congratulations.
Odoo V9
5. Extra information
In the script you saw there was an option to change the Odoo port (OE_PORT). When you’d change this port number to 8070 in the install script it would be applied to /etc/your-config-file.conf and this would give you the ability to change the default port.
To apply these changes you should do the following:
The -c will change the configuration and memorize what you’ve changed under /etc/your-config-file.conf. Because my port was set to 8070 this is telling the Odoo that it should run on port 8070. When you would now open up your browser and navigate to http://localhost:8070/ you will see it is running there:
Odoo V9 alternative port
This issue comes form installing the postgres package with out a version number. Although postgres will be installed and it will be the correct version the script to setup the cluster will not be run correctly. It's a packaging issue. If your comfortable with Postgres there is a script you can run to crete this cluster and get postgres running however if your like me then you do it the easy way. First purdge the old postgres install. The issue currently lies with 9.1 so I will assume that's what you have installed
sudo apt-get remove --purge postgresql-9.1
Now simply reinstall
sudo apt-get install postgresql-9.1
Note the package name with the version number. HTH.
I have installed odoo using http://openies.com/blog/install-openerp-odoo-9-on-ubuntu-server-14-04-lts/ got no issue with the fresh ubuntu 14.04 LTS.
But, you need to check that there is no postmaster.pid in your postgres directory, probably /usr/local/var/postgres/
Remove this and start server using
rm /usr/local/var/postgres/postmaster.pid
It should work.
Check this to install odoo 10 in ubuntu 16.04 LTS
Bitnami ODOO, easy to install in your Machine.
Download from Here
It is compatible with preinstall postgresql.
As mentioned before you can use one simple script to install Odoo of any version (9, 10, 11).
Follow the steps:
Log in to your system and work as an superuser: sudo su
Update the system: apt-get update
Download the script. You can change to the version of your choice:
wget https://raw.githubusercontent.com/Yenthe666/InstallScript/11.0/odoo_install.sh
Run the script: ./odoo_install.sh
Now you can access Odoo at http://serverIP:8069
If you are running it locally that would be 127.0.0.1:8069
The next steps would be to configure the Apache/Nginx or another server to point a domain to the Odoo instance. Also, remember to set the proper access rules on your server (for example on Amazon that would be by opening the port 80 and 8069 in the security rules). It is also wise to change the default password in Odoo config from admin to something more secure.
If you used the script without editing your Odoo config file would be installed in /etc/odoo-serfer.config. Use nano, vi or another editor to change the default settings.