环境:

  远程机: linux + Mysql 

  本地机: Windows + RStudio

问题:

  1. 远程机为内网机器,需要跳板机连接,没有公网ip,无法连接

  解决方案:修改跳板机的iptables,将内网机器映射了到跳板机的a端口上

  2. 使用RMySQL连接时出现Host * is not allowed to connect to this MySQL server

      RMySQL连接方法如下

rm(list = ls())
library(RMySQL)

DB_name <- "dbname"
con <- dbConnect(dbDriver('MySQL'),dbname=DB_name,
                 user = 'root', password = '123456',
                 host = '*.*.*.*',port = *)

  出现此问题的原因是内网机器没有开放root帐号的远程权限.需要登录内网机器的mysql修改配置:

mysql -u root -p123456
mysql
>use mysql; mysql>update user set host = '%' where user = 'root'; FLUSH PRIVILEGES;

 

相关文章:

  • 2021-09-29
  • 2021-12-23
  • 2021-12-06
  • 2022-02-04
猜你喜欢
  • 2021-07-29
  • 2021-10-28
  • 2021-08-09
  • 2022-12-23
  • 2021-07-30
  • 2021-04-15
  • 2021-08-07
相关资源
相似解决方案