Quick reference:

Create a user

mysql> CREATE USER 'username'@'localhost' IDENTIFIED BY 'passwd';

 

Assign privileges to the user

mysql> GRANT ALL PRIVILEGES ON db_name.* TO 'username'@'localhost';

or

mysql> GRANT SELECT,DELETE,UPDATE ON db_name.* TO 'username'@'localhost';