Documentation

Create MySQL User And Grant Privileges

A
Adam Birds
Published 10 August 20261 min read1 views

To create a MySQL user and grant privileges run the below commands:

CREATE USER 'username'@'localhost' IDENTIFIED BY 'SuperSecurePassword';
GRANT ALL PRIVILEGES ON databasename . * TO 'username'@'localhost';
FLUSH PRIVILEGES;
Last updated: 10 August 2026v1