I recently used MacPorts to upgrade from MySQL 5.5 to 5.6. I can use my database fine on my laptop. I tried to enable remote access to the database so I could edit the database using DB clients on other computers on my network, but after I logged in as root OK, it said access denied for root:

$ mysql -u root -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 31
Server version: 5.6.19 Source distribution

Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> GRANT ALL PRIVILEGES ON *.* TO 'username'@'%' IDENTIFIED BY 'password' WITH GRANT OPTION;
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

I have tried the answer posted mysql how to fix Access denied for user 'root'@'localhost' and it does not fix the problem

  • 1
    @duDE I tried the answer from the question you think this is a duplicate of, and it did not fix the problem. – gknauth Sep 8 '14 at 16:04
  • The problem is NOT that I can't login as root. I can! The problem is that AFTER logging in as root, I can't get the GRANT ALL PRIVILEGES... command to work. – gknauth Sep 8 '14 at 16:06
  • 1
    Run mysqld with --skip-grant-tables and then login and grant yourself perms. – ssnobody Sep 8 '14 at 18:08
  • try this CREATE USER ‘username‘@’host_machine‘ IDENTIFIED BY ‘some_pass‘; GRANT ALL PRIVILEGES ON *.* TO ‘username‘@’host_machine‘WITH GRANT OPTION; CREATE USER ‘username‘@’%’ IDENTIFIED BY ‘password‘; GRANT ALL PRIVILEGES ON *.* TO ‘username‘@’%’WITH GRANT OPTION; – Renju Chandran chingath Sep 14 '14 at 21:04

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.