# Notes ## Postgresql ### Creating a user and the database To create a new user within postgresql, enter the shell via `helperbot --psql`. First we'll create the user. Use the following: ```sql CREATE USER WITH ENCRYPTED PASSWORD ''; ``` Now within the shell, you can just. Type in `\q` to quit. ```sql CREATE DATABASE ; ``` Now you need to give the user proper permissions to access the database, otherwise it will fail to work with whatever application we want to hook it up with. ```sql GRANT ALL PRIVILEGES ON DATABASE TO ; \c -- switch to the database GRANT ALL ON SCHEMA public TO ; ``` If you ever need to delete a user and their database: ```sql DROP DATABASE ; DROP USER ; ```