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?

Recommended Answers

All 4 Replies

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.

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

mysql>

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.

That got it fixed. Thanks guys. :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.