The instructions come from debuntu.org.
First I need to log into mysql's CLI:
- mysql -u root -p
Then, I need to create the database named 'db1':
- create database db1;
Next, we make a user called 'user1' with password 'pass1':
- grant usage on *.* to user1@localhost identified by 'pass1';
Finally, we grant privileges to our 'user1':
- grant all privileges on db1.* to user1@localhost;
Voila! Now, you have a new user with their own database in MySQL.