In this quick post I will show you how to create a MySQL user on Ubuntu 12.04.
First you need to login with one of the following commands.
mysql -u root -p or sudo mysql -p
Now to create an account just run this next command.
create user ‘account_username’@'localhost’ identified by ‘account_password’;
You should see something like the screenshot below now.
Now your user is created but can’t access databases or tables, to fix that you need to run the following command.
grant all on database_name.* to account_username@localhost
This will give the new user complete access to the given database. You can also limit what a MySQL user can do if you need to however I have never had to do that before and probably never will have to.