Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DB まわり #39

Open
kokoichi206 opened this issue Jan 18, 2023 · 1 comment
Open

DB まわり #39

kokoichi206 opened this issue Jan 18, 2023 · 1 comment

Comments

@kokoichi206
Copy link
Member

postgres のパスワードってなんやっけ

$ sudo passwd postgres

TODO

drop db したい
→ 今入ってる db では削除できないよ〜って言われる
→ 一般ユーザーで作成しようとすると cannnot create db って言われる
→ postgresql のルートユーザーっぽい、postgres っていうユーザーでログインしようとするも、パスワードわからない

@kokoichi206
Copy link
Member Author

$ sudo vim /etc/postgresql/12/main/pg_hba.conf
>  88 # Database administrative login by Unix domain socket
 89 #local   all             postgres                                peer
 90 local   all             postgres                                trust

$ sudo -u postgres psql
psql (12.8 (Ubuntu 12.8-0ubuntu0.20.04.1))
Type "help" for help.

postgres=# \password
Enter new password: 
Enter it again: 
postgres=# \q
sudo service postgresql restart

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant