Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- hostnamectl set-hostname postgres
- mcedit /etc/hosts
- PostgreSQL
- apt update && sudo apt upgrade -y
- apt-get install wget sudo curl gnupg2 -y
- sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
- wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
- apt -y update
- apt-get install postgresql-15 -y
- systemctl start postgresql
- systemctl enable postgresql
- systemctl status postgresql
- ss -antpl | grep 5432
- sudo -u postgres psql -c "SELECT version();"
- su postgres
- psql
- ALTER USER postgres PASSWORD '1234566';
- CREATE DATABASE test;
- \l
- \c test
- \dt
- exit
- backup
- su - postgres
- pg_dump -d test -f test_backup.sql
- restore
- su - postgres
- psql -d test -f test_backup.sql
- mcedit /etc/postgresql/15/main/postgresql.conf
- listen_addresses = '*'
- mcedit /etc/postgresql/15/main/pg_hba.conf
- host all all 10.20.7.1/24 password
- systemctl restart postgresql
- systemctl status postgresql
- psql -h 10.20.7.114 -U usersql
- sudo curl https://www.pgadmin.org/static/packages_pgadmin_org.pub | sudo apt-key add
- sudo sh -c 'echo "deb https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/$(lsb_release -cs) pgadmin4 main" > /etc/apt/sources.list.d/pgadmin4.list && apt update'
- sudo apt install pgadmin4 -y
- sudo /usr/pgadmin4/bin/setup-web.sh
- systemctl status apache2
- http://localhost/pgadmin4
- ssh-keygen -t rsa -b 4096
- cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
- chmod 0600 authorized_keys
- id_rsa
- psql -h 10.20.7.123 -U postgres aster117 < /usr/src/asterisk-20.6.0/contrib/realtime/postgresql/postgresql_cdr.sql
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement