2

I'm trying to grant full privileges to the root user. Having tried via Workbench (Windows), this failed with the message:

Access denied for user 'root'@'%' (using password: YES)

Having researched the issue (trying fixes as suggested here and here), I have tried to resolve by granting root privileges via the command line, which fails with the same message.

enter image description here

If I try to grant privileges on 'root'@'localhost' instead, I get the same error, presumably because I am still trying to set through user 'root'@'%'?

enter image description here

The MySQL docs (http://dev.mysql.com/doc/refman/5.1/en/access-denied.html) say

If you get the following error, it means that you are using an incorrect root password:

shell> mysqladmin -u root -pxxxx ver Access denied for user 'root'@'localhost' (using password: YES)

But I know the password is correct.

Security is not a major concern at the moment (running on a firewalled dev machine).

The result of SHOW GRANTS FOR 'root'@'%'; is as follows:

Grants for root@%

GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS,
FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY 

TABLES,
LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW
VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, TRIGGER, CREATE TABLESPACE ON
*.* TO 'root'@'%' IDENTIFIED BY PASSWORD '<REMOVED>' |
| GRANT PROXY ON ''@'' TO 'root'@'%' WITH GRANT OPTION

What am I doing wrong here?

Community
  • 1
  • 1
gbro3n
  • 6,729
  • 9
  • 59
  • 100
  • What happens if you use a machine name, rather than `'%'` (which will match to any machine name)? – TZHX Feb 05 '15 at 10:51
  • I try to grant privileges on 'root'@'localhost' instead, I get the same error, presumably because I am still trying to set through user 'root'@'%'? (Post edited to show output) – gbro3n Feb 05 '15 at 11:01
  • What does this show you `show grants for 'root'@'%';` – Mihai Feb 05 '15 at 11:04
  • I've updated the question to show the output of `show grants for 'root'@'%';` – gbro3n Feb 05 '15 at 11:08
  • Thats weird for me `show grants` shows me exactly your first query.One solution is to remove all grants and regrant them but if you remove the grants you might not be able to grant them back,so be careful. – Mihai Feb 05 '15 at 11:23
  • Ended up reinstalling mysql, and copying the default mysql database over to the data directory. – gbro3n Feb 05 '15 at 12:44

0 Answers0