Unable to Use "GRANT" command in our DB. Throws an error.

Steve Hood
Steve Hood used Ask the Experts™
on
HI All,

Hope somebody can help. I need to grant remote root access to our MySQL database to a developer. I've done this in the past with out issue using the command line inputs below. However, this time it throws an error Error When Trying to Grant An IP Access to ROOT and I cannot figure out why or how to make this work. Any idea?

mysql> use mysql
mysql> GRANT ALL ON *.* to root@'IP Address' IDENTIFIED BY password';
mysql> FLUSH PRIVILEGES;
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Dave BaldwinFixer of Problems
Most Valuable Expert 2014

Commented:
You first have to create a user called 'root' with access from that IP address before you can grant anything.  Remote 'root' access is never allowed by default.
theGhost_k8Database Consultant

Commented:
Just to add into @Dave's comment above, you can verify the current user's capabilities by using following command:
show grants;

Open in new window



Permission required is "GRANT OPTIONS"
Ref: https://dev.mysql.com/doc/refman/5.6/en/grant.html
Steve HoodIT Manager

Author

Commented:
Hi there, thanks for your suggestion. I did that and this is what came up.
mysql> show grants;
+-------------------------------------------------------------------------------
-------------------------------+
| Grants for root@%
                               |
+-------------------------------------------------------------------------------
-------------------------------+
| GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY PASSWORD '*67F60C26B9A
B9C99C32995C0B2F8A6382071A31A' |
+-------------------------------------------------------------------------------
-------------------------------+
1 row in set (0.00 sec)
IT Manager
Commented:
Thanks everyone.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial