如何为mysql启用远程登录。

时间:2018-02-16 01:01:37

标签: mysql

我有两个节点:node1node2。我想从node1访问node2上安装的MySQL。

我到目前为止尝试在MySQL上使用grant all privileges on *.* to 'mysql'@'node2.openstacklocal' with grant option;,但我仍然遇到以下错误:

===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)

1 个答案:

答案 0 :(得分:-1)

我想我得到了解决方案

  1. 登录mysql
  2. 运行命令 grant all on mysql.* to '<remoteuser>'@'node2.openstacklocal' identified by 'password';
  3. 注意 - 请注意,此命令缺少单词&#39; privileges&#39;