Is the server running on host "localhost" (::1) and accepting TCP/IP connections on port 5432? Failed to connect to the database: could not connect to server: Connection refused When I run the comand msfconsole in a terminal, although metasploit connects to the msf database on port 5432, the following error message msfconsole Postgresql 10 listening on port 5433 instead of 5432. So I had two versions of postgresql (10 & 9.6) installed in my debian machine. When I updated postgresql from the Synaptic application, it is the postgresql 10 version that was installed. Thanks to Code Friendly, & I want to share how I solved my problem. Remove the postgres user: sudo deluser postgres Remove the following folders sudo rm -rf /var/lib/postgresql/ Remove all above listed sudo apt-get -purge remove postgresql postgresql-8.3 postgresql-client postgresql-client-8.3 postgresql-client-common postgresql-common postgresql-contrib postgresql-contrib-8.3 Ii postgresql-contrib-8.3 8.3.9-0ubuntu8.04 additional facilities for PostgreSQL Ii postgresql-contrib 8.3.9-0ubuntu8.04 additional facilities for PostgreSQL (latest Ii postgresql-common 87ubuntu2 PostgreSQL database-cluster manager Ii postgresql-client-common 87ubuntu2 manager for multiple PostgreSQL client versi Ii postgresql-client-8.3 8.3.9-0ubuntu8.04 front-end programs for PostgreSQL 8.3 Ii postgresql-client 8.3.9-0ubuntu8.04 front-end programs for PostgreSQL (latest ve Ii postgresql-8.3 8.3.9-0ubuntu8.04 object-relational SQL database, version 8.3 Ii postgresql 8.3.17-0ubuntu0.8.04.1 object-relational SQL database (latest versi List All Postgres related packages dpkg -l | grep postgres delete_old_cluster.Steps that worked for me on Ubuntu 8.04.2 to remove postgres 8.3 If you wish to remove PostgreSQL 9.x and its data. If everything is working, set the PostgreSQL 10 service to start automatically systemctl enable postgresql-10 Start the server systemctl start rviceĪnalyze and optimize the new cluster. View the old configuration nano /var/lib/pgsql/9.5/data/pg_hba.confĮdit the new configuration nano /var/lib/pgsql/10/data/pg_hba.conf To (apostrophes may not survive copy/paste, may want to hand enter) listen_addresses = '*' If you need to connect from other servers, make sure to change: #listen_addresses = 'localhost' You can make your changes to the 10 configuration with: nano /var/lib/pgsql/10/data/nf You can view your 9.5 configuration with: nano /var/lib/pgsql/9.5/data/nf I’d recommend making the changes to the new version rather than copying over nf from 9.5, since there are a bunch of new options in the PostreSQL 10 version of the file. Migrate your database from the 9.x version to 10 /usr/pgsql-10/bin/pg_upgrade -old-datadir /var/lib/pgsql/9.5/data/ -new-datadir /var/lib/pgsql/10/data/ -old-bindir /usr/pgsql-9.5/bin/ -new-bindir /usr/pgsql-10/bin/ usr/pgsql-10/bin/initdb -D /var/lib/pgsql/10/data/ Initialize the PostgreSQL 10 database sudo su postgres Stop Postgresql 9.5 and Postgresql 10 sudo systemctl stop postgresql-9.5.service & sudo systemctl stop rvice Install PosgreSQL 10 sudo yum install postgresql10-server Install the repo RPM for PosgresSQL 10 sudo yum install If you’re upgrading from a different version, just replace 9.5 and 95 wherever you see it with your appropriate version number. In these examples, I’m using upgrading from PostgreSQL 9.5. Here’s a quick rundown on upgrading a very simply configured PostgreSQL 9.x server to PostgreSQL 10 running on Centos 7.įirst, and this goes without saying, backup your server! ( An updated version of this post for upgrading to PostgreSQL 11 is available here)
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |