search

Home  >  Q&A  >  body text

如何设置mysql可以通过内网访问?

两台阿里云ECS服务器都有内网IP(不同),一台A服务器用作mysql数据库+少量web访问,另一台B
纯粹web访问。
目前A服务器开启外网访问,B服务器可以通过公网IP访问到数据库。
需求是如何配制A服务器的mysql,可以让B服务器通过内网ip去访问它?

天蓬老师天蓬老师2827 days ago673

reply all(3)I'll reply

  • 大家讲道理

    大家讲道理2017-04-17 14:22:34

    The bind-address in my.cnf is configured as A's intranet ip
    mysql corresponding user settings allow access to B's intranet ip
    Configure A's firewall rules (don't worry if the firewall is not enabled by default)

    reply
    0
  • PHPz

    PHPz2017-04-17 14:22:34

    When generating a user, limit the user's IP or MYSQL only allows access to the specified IP.
    If the user is generated, username@host must be configured when generating the user.
    If you configure MYSQL to only allow specified IP access, find the
    bind-address line in the mysql configuration file and add address access according to the original example

    reply
    0
  • 巴扎黑

    巴扎黑2017-04-17 14:22:34

    http://blog.csdn.net/duck_arrow/article/...

    reply
    0
  • Cancelreply