MySQL – Create new user

By | 25 April, 2013

The use case scenario was an installation of Tiny Tiny RSS that doesnt allow an empty MySQL password. My local mysql doesnt have a password set so i was stuck on that screen.

To fix it, i just had to create a new user on my mysql, give it privileges and a non empty password. To do it, i did this:

Connect to your mysql server as root (just open a command prompt and, unless you have you bin mysql dir on your PATH, steer to your bin dir):

c:\whatever> mysql –user=root mysql

(Please note that there are two hyphens before the word “user” on the command above)

After connecting, add the user:

mysql> CREATE USER ‘username’@’localhost’ IDENTIFIED BY ‘user_pass’;
mysql> GRANT ALL PRIVILEGES ON *.* TO ‘username’@’localhost’ WITH GRANT OPTION;

Obviously replace “username” by the name os the user you want to create and “user_pass” guessed it, its password.

After these steps, you are good to go enjoy your tiny tiny rss install with a non empty mysql password.

As usual, here are some links where you can learn more about this (from MySQL manual):

To read: 6.3.2. Adding USer Accounts (opens in a new window/tab)