新手在这里 – 问题:无法build立远程连接到mariadb(mysql)从mac或gscript centos7 – 设置:我有2台灯机:一个testing(107)和另一个生产(35)107 – centos6.5与mysql(数字海洋中的vps)35 – centos7与mariadb-server-5.5.52-1.el7.x86_64(gcloud上的计算引擎)db,dbuser,dbpass和port(3306)
– 我试了一下:1. https://mariadb.com/kb/en/library/configuring-mariadb-for-remote-client-access/35看起来像这样:
[mysqld] datadir=/var/lib/mysql socket=/var/lib/mysql/mysql.sock # Disabling symbolic-links is recommended to prevent assorted security risks symbolic-links=0 # Settings user and group are ignored when systemd is used. # If you need to run mysqld under a different user or group, # customize your systemd unit file for mariadb according to the # instructions in http://fedoraproject.org/wiki/Systemd #skip-networking bind-address = 0.0.0.0 [mysqld_safe] log-error=/var/log/mariadb/mariadb.log pid-file=/var/run/mariadb/mariadb.pid # # include all files from the config directory # !includedir /etc/my.cnf.d
trusted (active) target: ACCEPT icmp-block-inversion: no interfaces: eth0 sources: services: http https ports: 3306/tcp protocols: masquerade: no forward-ports: sourceports: icmp-blocks: rich rules: public target: default icmp-block-inversion: no interfaces: sources: services: dhcpv6-client http https ssh ports: 3306/tcp protocols: masquerade: no forward-ports: sourceports: icmp-blocks: rich rules:
我已经在这个3天了,我不是很接近解决这个问题。 任何帮助表示赞赏。 我错过了什么?
谢谢。
3天的谷歌search和45分钟后发布这个问题后,我想通了,并认识到,gcloud也可能有一个防火墙,瞧瞧,它确实,我发现这个文件:
https://cloud.google.com/solutions/mysql-remote-access#modify_the_default_firewall_rule
我开始为tcp:3306创build一个入口规则,现在我可以远程连接,我的gscript正在与我的gcloud的计算引擎实例通信。
这需要庆祝!
希望它可以帮助别人。