22 lines
397 B
Bash
22 lines
397 B
Bash
|
#!/usr/bin/zsh
|
||
|
|
||
|
# Postgres
|
||
|
apt install -y \
|
||
|
postgresql
|
||
|
|
||
|
sudo systemctl start \
|
||
|
postgresql postgresql-client
|
||
|
|
||
|
VER=`psql --version | grep -Eo ' [0-9]+\.[0-9]+ ' | grep -Eo ' [0-9]+' | xargs`
|
||
|
|
||
|
sudo nano /etc/postgresql/$VER/main/pg_hba.conf
|
||
|
# `local all all trust`
|
||
|
|
||
|
sudo systemctl restart postgresql.service
|
||
|
|
||
|
psql -U postgres
|
||
|
```
|
||
|
ALTER USER postgres WITH PASSWORD '2m9tY_KN@5vM%Pn2M#g';
|
||
|
exit
|
||
|
```
|