1

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

4
  • 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, 2014 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, 2014 at 16:06
  • 1
    Run mysqld with --skip-grant-tables and then login and grant yourself perms. Sep 8, 2014 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; Sep 14, 2014 at 21:04

0

You must log in to answer this question.

Browse other questions tagged .