<legend id='f2wh3'><style id='f2wh3'><dir id='f2wh3'><q id='f2wh3'></q></dir></style></legend>

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

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

        <bdo id='f2wh3'></bdo><ul id='f2wh3'></ul>
      <tfoot id='f2wh3'></tfoot>

        Zend_Db:如何通过 SSH 隧道连接到 MySQL 数据库?

        时间:2023-05-30

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

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

              <bdo id='KbRqN'></bdo><ul id='KbRqN'></ul>

                <legend id='KbRqN'><style id='KbRqN'><dir id='KbRqN'><q id='KbRqN'></q></dir></style></legend>
                    <tbody id='KbRqN'></tbody>
                  <tfoot id='KbRqN'></tfoot>
                • 本文介绍了Zend_Db:如何通过 SSH 隧道连接到 MySQL 数据库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  如何使用 PHP 和 Zend 框架连接到需要 SSH 隧道的 MySQL 数据库?

                  How can I connect to a MySQL database that requires an SSH tunnel using PHP and the Zend Framework?

                  推荐答案

                  只需启动 SSH 隧道并使用本地端口作为您的 MySQL 端口.

                  Just start up SSH tunnel and use the local port as your MySQL port.

                  例如,您像这样启动隧道,

                  For example, you start tunnel as this,

                  ssh -f user@mysql-server.com -L 3306:mysql-server.com:3306 -N
                  

                  你可以像这样连接到 MySQL,

                  And you can connect to MySQL like this,

                  $conn = mysql_connect('localhost', 'mysql_user', 'mysql_password');
                  

                  对于 zend_db,你这样做,

                  For zend_db, you do this,

                  $config = new Zend_Config(
                      array(
                          'database' => array(
                              'adapter' => 'Mysqli',
                              'params'  => array(
                                  'host'     => 'localhost',
                                  'dbname'   => 'my_db',
                                  'username' => 'mysql_user',
                                  'password' => 'mysql_password',
                              )
                          )
                      )
                  );
                  
                  $db = Zend_Db::factory($config->database);
                  

                  这篇关于Zend_Db:如何通过 SSH 隧道连接到 MySQL 数据库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:学说 2 和 Zend 分页器 下一篇:Zend_Log in application.ini

                  相关文章

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

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

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