0

I have this .sql script I've written which, among other things, creates the DB, creates tables, creates procedures, and sets up users.

Here is a segment of it:

DELETE FROM mysql.user WHERE User = 'fwtrRWW';
DELETE FROM mysql.user WHERE User = 'fwtrRW';
DELETE FROM mysql.user WHERE User = 'fwtrR';

FLUSH PRIVILEGES;

CREATE USER 'fwtrRWW'@'localhost' IDENTIFIED BY 'abc123';
CREATE USER  'fwtrRW'@'localhost' IDENTIFIED BY 'abc213';
CREATE USER  ' fwtrR'@'localhost' IDENTIFIED BY 'qwerty';

FLUSH PRIVILEGES;

GRANT ALL                    ON fwtr.* TO 'fwtrRWW';
GRANT SELECT, INSERT, UPDATE ON fwtr.* TO 'fwtrRW';
GRANT SELECT                 ON fwtr.* TO 'fwtrR';

I keep getting MySQL error 1133: Can't find any matching row in the user table, despite the fact that SELECT * FROM mysql.User clearly shows that the users are there.

I have tried putting more FLUSH PRIVILEGES in here and there but it doesn't seem to help like it does for others on other forums.

Any ideas what might be wrong?

2
  • 2
    Add @'localhost' to the usernames in your grant statement? Commented Aug 18, 2011 at 2:43
  • 1
    Try DROP USER instead of accessing the users table directly: DROP USER 'fwtrRWW'@'localhost' Commented Aug 18, 2011 at 7:15

1 Answer 1

2

I think you just need to change your GRANT statements to:

GRANT ALL                    ON fwtr.* TO 'fwtrRWW'@'localhost';
GRANT SELECT, INSERT, UPDATE ON fwtr.* TO 'fwtrRW'@'localhost';
GRANT SELECT                 ON fwtr.* TO 'fwtrR'@'localhost';
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.