How to create MySql user and grant all privileges on specific database

5 August 2025

As the title says ...

CREATE USER 'some_username'@'localhost' IDENTIFIED BY 'some_password';
GRANT ALL PRIVILEGES ON db_name.* TO 'some_username'@'localhost' WITH GRANT OPTION;