Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Возможно также потребуется дать права: chmod -x /home/mysales/start.sh

Инсталляция PostgreSQL (Ubuntu)

Code Block
# Create the file repository configuration:
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'

# Import the repository signing key:
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -

# Update the package lists:
sudo apt-get update

# Install the latest version of PostgreSQL.
# If you want a specific version, use 'postgresql-12' or similar instead of 'postgresql':
sudo apt-get -y install postgresql

sudo systemctl start postgresql

sudo nano /etc/postgresql/14/main/pg_hba.conf:

Code Block
host       all   mysales  0.0.0.0/0  md5
#host       all   mysales  10.100.0.0/16 md5
#host       all   mysales  192.168.44.0/24 md5

sudo nano /etc/postgresql/14/main/postgresql.conf

Code Block
listen_addresses = '*'          # what IP address(es) to listen on;

sudo -u postgres psql -c "CREATE USER mysales WITH PASSWORD 'password'"

sudo -u postgres psql -c "ALTER USER mysales WITH PASSWORD 'password'"

sudo -u postgres psql

CREATE DATABASE mysales;

grant all privileges on database mysales to mysales;