SQL
Here I gather some of the common commands for SQL databases
MySQL
Create and use new database:
CREATE DATABASE new_db;
USE DATABASE new_db;
Create a new user:
CREATE USER 'new_user'@'localhost' IDENTIFIED BY 'new_password';
Set privileges of the created user
GRANT ALL PRIVILEGES ON new_db.* TO 'new_user'@'localhost';
FLUSH PRIVILEGES;
PostgreSQL
Create a new user:
CREATE USER new_user WITH PASSWORD 'new_password';
Set privileges of the created user
GRANT ALL PRIVILEGES ON DATABASE new_db TO new_user;