PostgreSQL - Create user & grant permission on a database
Create user & grant permission on a PostgreSQL database
Snippets
CREATEUSERyour_username;ALTERUSER your_username WITHENCRYPTEDPASSWORD'your_password';CREATEDATABASEyour_database_name;//Grant all PRIVILEGESGRANT ALL PRIVILEGES ONDATABASE your_database_name TO your_username;//GrantReadonlyGRANTSELECT, SHOW VIEW ON`your_database_name`.*TO'your_username' @ '%';