quick snippet for creating a user w/ mysql cli.
First, login and create a user:
$ mysql -u root_user -p
mysql > CREATE USER 'username'@'place' IDENTIFIED BY 'password';
then, grant privileges to it. The syntax is as follows:
GRANT [type of permission] ON [database name].[table name] TO ‘[username]’@'localhost’
Now, create a database so that the user will be able to manage it:
mysql> CREATE DATABASE database_name;
Now, in our case, apply:
mysql> GRANT ALL PRIVILEGES ON database_name.* TO 'username'@'place';
Finally, execute flush to reload internal caches and the grant tables (you must have RELOAD permission).
mysql> FLUSH PRIVILEGES;