Today while assigning right new user in mysql from command line. I got error 1133:can’t find any matching row in the user table

GRANT ALL PRIVILEGES ON `mydb` . * TO ‘newuser’@’localhost’;

After some troubleshoot I found that my ‘newuser’ was not created properly. To check and solve that you need to go through following steps.

Open your command prompt

C:> Mysql -u root -p pwd
mysql> use database mysql
mysql> select user, password, hostname from user


mysql database is where you keep your user profiles. The table name where user profile data are kept in is called user.

check which field is missing. it’s either password or hostname. Update your mysql.user table with required value.

mysql> update mysql.user, set password=(‘password’) where user=newuser

or

mysql> update mysql.user, set hostname =’hostname ‘ where user=newuser

This password is then encripted so it won’t show up the same which you have entered.

Leave a Reply