1
MySQL/MariaDB database and user creation
Database Management | by dorianniemiec | submitted in September 28, 2024
This SQL script creates a database and an user, and assigns permissions for a database to a user. Created for MySQL/MariaDB DBMS's.
-- Replace "db", "user" and "password" with respective database names, usernames and passwords
CREATE DATABASE db;
CREATE USER user IDENTIFIED BY 'password';
GRANT ALL ON db.* TO user;