# mariadb ```sql CREATE USER 'newuser'@'%' IDENTIFIED BY 'password'; GRANT ALL PRIVILEGES ON db.* TO 'newuser'@'%'; FLUSH PRIVILEGES; ``` ```sql REVOKE type_of_permission ON database_name.table_name FROM 'username'@'localhost'; ``` # postgres ```sql create database mydb; create user myuser with encrypted password 'mypass'; grant all privileges on database mydb to myuser; alter database mydb owner to myuser; ```