0

When I run:
---mysql> SET PASSWORD FOR 'garrett'@'localhost' = PASSWORD('abc123');
I get:
---ERROR 1133 (42000): Can't find any matching row in the user table

Also, when I run:
---mysql> UPDATE mysql.user SET Password=PASSWORD('abc123') WHERE User='garrett' AND Host='localhost';

I get:
---Query OK, 0 rows affected (0.00 sec)
---Rows matched: 0 Changed: 0 Warnings: 0

So then to test this I exit and login as my user name, garrett

mysql -u garrett -p
Enter password: abc123
---ERROR 1045 (28000): Access denied for user 'garrett'@'localhost' (using password: YES)

Any ideas?

3
Contributors
4
Replies
19
Views
3 Years
Discussion Span
Last Post by lewashby
0

When you get a response back that says 0 rows affected it means that no records were updated. Try

SELECT * FROM mysql.user  
 WHERE User='garrett' 
   AND Host='localhost';

and see if any records are returned.

0
mysql> select * from mysql.user where User='garrett' and Host='localhost';
Empty set (0.00 sec)

mysql>
0

So there is no user called garrett with Host = localhost but it could be in there another way (i.e. garrett@%). Try just this and see what you get:

select * from mysql.user where User = 'garrett';

If you still get 0 rows then he does not exist. To add the user you will need something like this to create the user and them give them access to a specific database:

CREATE USER 'garrett'@'localhost' IDENTIFIED BY 'some_password';
GRANT ALL PRIVILEGES ON some_database.* TO 'garrett'@'localhost'
WITH GRANT OPTION;

let us know how it goes.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.