• <small id='laDGa'></small><noframes id='laDGa'>

      <tfoot id='laDGa'></tfoot>
      <i id='laDGa'><tr id='laDGa'><dt id='laDGa'><q id='laDGa'><span id='laDGa'><b id='laDGa'><form id='laDGa'><ins id='laDGa'></ins><ul id='laDGa'></ul><sub id='laDGa'></sub></form><legend id='laDGa'></legend><bdo id='laDGa'><pre id='laDGa'><center id='laDGa'></center></pre></bdo></b><th id='laDGa'></th></span></q></dt></tr></i><div id='laDGa'><tfoot id='laDGa'></tfoot><dl id='laDGa'><fieldset id='laDGa'></fieldset></dl></div>

        • <bdo id='laDGa'></bdo><ul id='laDGa'></ul>
        <legend id='laDGa'><style id='laDGa'><dir id='laDGa'><q id='laDGa'></q></dir></style></legend>

        使用 Cloud sql 代理连接到多个 CloudSQL 实例?

        Connecting to multiple CloudSQL instances using Cloud sql proxy?(使用 Cloud sql 代理连接到多个 CloudSQL 实例?)

        1. <i id='kpNtC'><tr id='kpNtC'><dt id='kpNtC'><q id='kpNtC'><span id='kpNtC'><b id='kpNtC'><form id='kpNtC'><ins id='kpNtC'></ins><ul id='kpNtC'></ul><sub id='kpNtC'></sub></form><legend id='kpNtC'></legend><bdo id='kpNtC'><pre id='kpNtC'><center id='kpNtC'></center></pre></bdo></b><th id='kpNtC'></th></span></q></dt></tr></i><div id='kpNtC'><tfoot id='kpNtC'></tfoot><dl id='kpNtC'><fieldset id='kpNtC'></fieldset></dl></div>

                <tbody id='kpNtC'></tbody>
              <tfoot id='kpNtC'></tfoot>
                  <bdo id='kpNtC'></bdo><ul id='kpNtC'></ul>
                • <legend id='kpNtC'><style id='kpNtC'><dir id='kpNtC'><q id='kpNtC'></q></dir></style></legend>

                  <small id='kpNtC'></small><noframes id='kpNtC'>

                  本文介绍了使用 Cloud sql 代理连接到多个 CloudSQL 实例?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在尝试使用云 sql 代理连接到 2 个不同的云 sql 实例...

                  I'm attempting to use the cloud sql proxy to connect to 2 different cloud sql instances...

                  在文档中,我找到了关于 Use -instances 参数的一行.对于多个实例,请使用逗号分隔的列表. 但不确定如何使其看起来.https://cloud.google.com/sql/docs/sql-proxy.我正在使用 Google 容器引擎,并且使用单个 CloudSQL 实例效果很好:

                  In the docs I found a line about Use -instances parameter. For multiple instances, use a comma-separated list. but not sure how to make that look. https://cloud.google.com/sql/docs/sql-proxy. I'm using Google Container engine, and with a single CloudSQL instance it works great:

                  - name: cloudsql-proxy
                    image: b.gcr.io/cloudsql-docker/gce-proxy:1.05
                    command: ["/cloud_sql_proxy", "--dir=/cloudsql",
                              "-instances=starchup-147119:us-central1:first-db=tcp:3306",
                              "-credential_file=/secrets/cloudsql/credentials.json"]
                    volumeMounts:
                    - name: cloudsql-oauth-credentials
                      mountPath: /secrets/cloudsql
                      readOnly: true
                    - name: ssl-certs
                      mountPath: /etc/ssl/certs
                  

                  但是对于多个我已经尝试过 -instances 部分,例如:

                  But for multiple I've tried the -instances section as such:

                  -instances=starchup-147119:us-central1:first-db,starchup-147119:us-central1:second-db=tcp:3306  
                  and  
                  -instances=starchup-147119:us-central1:first-db=tcp:3306,starchup-147119:us-central1:second-db=tcp:3306
                  

                  但它们都给出了各种错误;ECONNREFUSED 127.0.0.1:3306ER_DBACCESS_DENIED_ERRORER_ACCESS_DENIED_ERROR

                  but they all give various errors; ECONNREFUSED 127.0.0.1:3306, ER_DBACCESS_DENIED_ERROR, and ER_ACCESS_DENIED_ERROR

                  非常感谢任何帮助!

                  推荐答案

                  不能在同一个 TCP 端口上托管两个数据库.相反,在逗号分隔的列表中为每个数据库指定端口:

                  You cannot have two databases hosted on the same TCP port. Instead, specify ports for each database in the comma-separated list:

                  -instances=project:region:db=tcp:3306,project:region:db-2=tcp:3307
                  

                  我在这里使用了 3306 和 3307,但是您可以使用任何您想要的端口!确保容器引擎配置的其余部分允许这些端口上的节点之间进行通信(也许默认情况下确实如此,我不使用 GKE).

                  I used 3306 and 3307 here, but you can use any ports you want! Make sure that the rest of your Container Engine config allows for communication between nodes on these ports (maybe that's true by default, I don't use GKE).

                  大多数 mysql 驱动程序默认连接到端口 3306,但可以指定另一个端口.您必须安排您的代码连接到您为第二个数据库选择的不同端口.

                  Most mysql drivers connect to port 3306 by default but have a way to specify another port. You'll have to arrange for your code to connect to the different port you choose for the second database.

                  这篇关于使用 Cloud sql 代理连接到多个 CloudSQL 实例?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  ibtmp1是非压缩的innodb临时表的独立表空间,通过innodb_temp_data_file_path参数指定文件的路径,文件名和大小,默认配置为ibtmp1:12M:autoextend,也就是说在文件系统磁盘足够的情况下,这个文件大小是可以无限增长的。 为了避免ibtmp1文件无止境的暴涨导致
                  What does SQL clause quot;GROUP BY 1quot; mean?(SQL 子句“GROUP BY 1是什么意思?意思是?)
                  MySQL groupwise MAX() returns unexpected results(MySQL groupwise MAX() 返回意外结果)
                  MySQL SELECT most frequent by group(MySQL SELECT 按组最频繁)
                  Why Mysql#39;s Group By and Oracle#39;s Group by behaviours are different(为什么 Mysql 的 Group By 和 Oracle 的 Group by 行为不同)
                  MySQL GROUP BY DateTime +/- 3 seconds(MySQL GROUP BY DateTime +/- 3 秒)

                  <small id='n45FN'></small><noframes id='n45FN'>

                  • <i id='n45FN'><tr id='n45FN'><dt id='n45FN'><q id='n45FN'><span id='n45FN'><b id='n45FN'><form id='n45FN'><ins id='n45FN'></ins><ul id='n45FN'></ul><sub id='n45FN'></sub></form><legend id='n45FN'></legend><bdo id='n45FN'><pre id='n45FN'><center id='n45FN'></center></pre></bdo></b><th id='n45FN'></th></span></q></dt></tr></i><div id='n45FN'><tfoot id='n45FN'></tfoot><dl id='n45FN'><fieldset id='n45FN'></fieldset></dl></div>
                    <legend id='n45FN'><style id='n45FN'><dir id='n45FN'><q id='n45FN'></q></dir></style></legend>
                      <tfoot id='n45FN'></tfoot>

                        <tbody id='n45FN'></tbody>
                          <bdo id='n45FN'></bdo><ul id='n45FN'></ul>