0

I have two nodes: node1 and node2. I want to access MySQL installed on node1 from node2.

I have so far tried using grant all privileges on *.* to 'mysql'@'node2.openstacklocal' with grant option; on MySQL but I still get the below error:

===ERROR===
[mysql@node2 ~]$ mysql -p -h mgmt.openstacklocal  -u mysql  -P 3306
Enter password: 
ERROR 1045 (28000): Access denied for user 'mysql'@'node2.openstacklocal' (using password: YES)
Obsidian Age
  • 36,816
  • 9
  • 39
  • 58
RiteshC
  • 141
  • 2
  • 4
  • 1
    Possible duplicate of [MySQL ERROR 1045 (28000): Access denied for user 'bill'@'localhost' (using password: YES)](https://stackoverflow.com/questions/10299148/mysql-error-1045-28000-access-denied-for-user-billlocalhost-using-passw) – Obsidian Age Feb 16 '18 at 01:04

1 Answers1

-1

I guess I got the solution

  1. Login to mysql
  2. Run command grant all on mysql.* to '<remoteuser>'@'node2.openstacklocal' identified by 'password';

Note - Notice this command is missing word 'privileges'

RiteshC
  • 141
  • 2
  • 4
  • (a) The `PRIVILEGES` token is optional and does not change the meaning (consult [the documentation](https://dev.mysql.com/doc/refman/5.7/en/privileges-provided.html#priv_all) rather than randomly guessing); removing it did nothing. (b) Granting permissions to a remote user called "root" to the `mysql` database is remarkably stupid. (c) That hostname is invalid. I fail to see how this could be the solution to anything. – Lightness Races in Orbit Feb 16 '18 at 01:08
  • What will you do if you do not have access to mysql machine, and wants to access mysql from root ? No question is stupid, it is the person who do not understands it. – RiteshC Feb 16 '18 at 01:24
  • This is not "mysql machine" (whatever that is), or "mysql", this is _the `mysql` database_, a specific database inside your MySQL server that stores metadata. Giving root access to that remotely is not just a terrible idea, it's also not what your question asked about. – Lightness Races in Orbit Feb 16 '18 at 01:26
  • Dude this is just an example- To give access to a user (root in this case). – RiteshC Feb 16 '18 at 01:36
  • I have explained twice why it is not an example of what you think it is. I can't help it if you don't listen. I am also not your "dude". Good luck. – Lightness Races in Orbit Feb 16 '18 at 01:48