-- Creazione utente con password (se necessario cambiare l'host)
CREATE USER 'username'@'localhost' IDENTIFIED BY 'password';
-- Creazione database
CREATE DATABASE dbname;
-- Grant all'utente di tutti i privilegi sul database
GRANT ALL PRIVILEGES ON dbname.* TO 'username'@'localhost' WITH GRANT OPTION;
Wiki
2021-08-14
Creare database MySQL con utente e privilegi
Comandi rapidi per creare un nuovo database e un nuovo utente con tutti i permessi sul database, con MySQL.