Created
October 10, 2017 22:56
-
-
Save doevelopper/768fbba1ca42dec7236efb663d6ac187 to your computer and use it in GitHub Desktop.
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
-- from the command-line: | |
createdb -E UNICODE -l C -T template0 jiradb | |
-- CREATE DATABASE jiradb WITH ENCODING 'UNICODE' LC_COLLATE 'C' LC_CTYPE 'C' TEMPLATE template0; | |
-- | |
-- https://www.postgresql.org/docs/9.6/static/app-createuser.html | |
-- $> sudo su - postgres | |
-- $> createuser --interactive --pwprompt crowd | |
-- >n | |
-- >y | |
-- >n | |
-- $> logout | |
-- $> sudo su - crowd | |
-- $> createdb -E UNICODE -l C -T template0 crowddb | |
--List of databases | |
--postgres@devsecops:~$ psql -U postgres -l | |
# sudo -u postgres bash -c "psql -c \"CREATE USER crowdid WITH PASSWORD 'happyman';\"" | |
# sudo -u postgres bash -c "psql -c \"CREATE USER crowdid WITH PASSWORD 'happyman';\"" | |
# deleting a user | |
# sudo -u postgres bash -c "psql -c \"DROP USER crowd;\"" | |
# Grant access to user not created in the host | |
# postgres=# grant all privileges on database databasename to username; | |
# grant all privileges on database crowdiddb to crowdid; | |
# sudo -u postgres bash -c "psql -c \"GRANT ALL PRIVILEGES ON DATABASE \"crowdiddb\" to crowdid\""; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment