Come creare un utente privilegiato in MySQL
Come creare un utente privilegiato in MySQL
Tramite linea di comando MySQL possiamo creare facilmente un utente con tutti i privilegi su tabelle ed effettuare query. In questo articolo distinguiamo due modi per creare l’utente utilizzando queste query:
Senza password
CREATE USER 'landofworld'@'localhost';
CREATE USER 'landofworld'@'%';
GRANT ALL ON *.* TO 'landofworld'@'localhost';
GRANT ALL ON *.* TO 'landofworld'@'%';
Con password
CREATE USER 'landofworld'@'localhost' IDENTIFIED BY 'password';
CREATE USER 'landofworld'@'%' IDENTIFIED BY 'password';
GRANT ALL ON *.* TO 'landofworld'@'localhost';
GRANT ALL ON *.* TO 'landofworld'@'%';
Nota bene
Utilizzando il comando GRANT ALL impostiamo l’utente “landofworld” a ricevere tutti i privilegi tranne GRANT. Nella tabella degli utenti nella colonna dei privilegi globali noteremo che l’utente “landofworld” sarà impostato con ALL PRIVILEGES.