Last active
May 1, 2021 21:42
-
-
Save dutradotdev/3e2c27ca8e462be8b5a9954a341e1bdb to your computer and use it in GitHub Desktop.
POSTGRES Comandos
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Entrar no postgres: | |
- psql postgres | |
Criar usuário: | |
- CREATE ROLE strapi WITH LOGIN PASSWORD 'strapi'; | |
Alterar senha para senha encriptada: | |
- ALTER USE strapi WITH ENCRYPTED PASSWORD 'strapi123'; | |
Criar banco de dados: | |
- CREATE DATABASE strapi; | |
Dar todas as permissões do banco para um usuário específico: | |
- GRANT ALL PRIVILEGES ON DATABASE strapi TO strapi; | |
Listar bancos: | |
- \l | |
Listar usuários: | |
- \du | |
Para sair: | |
- \q | |
Fazer um import de dados: | |
- psql -h 127.0.0.1 -U strapi -d strapi -W < strapi.sql | |
-h: host | |
-U: user | |
-d: database | |
-W: pega os dados do usuário local |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment