1. <legend id='h3MKv'><style id='h3MKv'><dir id='h3MKv'><q id='h3MKv'></q></dir></style></legend>

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

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

      “与 MySQL 服务器的连接丢失"尝试连接到远程

      时间:2023-10-02

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

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

              • <bdo id='SZxXK'></bdo><ul id='SZxXK'></ul>
              • <small id='SZxXK'></small><noframes id='SZxXK'>

              • 本文介绍了“与 MySQL 服务器的连接丢失"尝试连接到远程 MySQL 服务器时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                问题描述

                我正在使用 Zend Framework 开发我的应用程序,并尝试连接到局域网中的远程 MySQL 数据库.

                Zend 中的数据库连接设置如下:<前>[一般的]db.adapter = PDO_MYSQLdb.params.host = 192.168.1.2db.params.port = 3306

                [现场直播:一般]db.params.username = rootdb.params.password = **db.params.dbname = djudd

                [开发:一般]db.params.username = rootdb.params.password = **db.params.dbname = 恒星引擎

                我收到以下错误:

                <块引用><块引用><块引用>

                致命错误:未捕获的异常 'PDOException' 带有消息 'SQLSTATE[HY000] [2013] 在'读取初始通信数据包'时失去与 MySQL 服务器的连接,系统错误:/usr/share/php/中的 111'Zend/Db/Adapter/Pdo/Abstract.php:129 堆栈跟踪:#0/usr/share/php/Zend/Db/Adapter/Pdo/Abstract.php(129): PDO->__construct('mysql:host=192....', 'root', 'password', Array) #1/usr/share/php/Zend/Db/Adapter/Pdo/Mysql.php(96): Zend_Db_Adapter_Pdo_Abstract->_connect() #2/usr/share/php/Zend/Db/Adapter/Abstract.php(448): Zend_Db_Adapter_Pdo_Mysql->_connect() #3/usr/share/php/Zend/Db/Adapter/Pdo/Abstract.php(238)): Zend_Db_Adapter_Abstract->query('DESCRIBEbny_c...', Array) #4/usr/share/php/Zend/Db/Adapter/Pdo/Mysql.php(156): Zend_Db_Adapter_Pdo_Abstract->query('DESCRIBE bny_c...') #5/usr/share/php/Zend/Db/Table/Abstract.php(823): Zend_Db_Adapter_Pdo_Mysql->describeTable('bny_core_module...', NULL) #6/usr/share/php/Zend/Db/Table/Abstract.php(866): Zend_Db_Table_Abstract->_setupMetadata() #7/usr/share/php/Zend/Db/Table/Abstract.在/usr/share/php/Zend/Db/Adapter/Pdo/Abstract.php 第 144 行

                请帮我解决这个问题.

                解决方案

                上次我遇到这种类型的错误时,我不得不将我的主机从:127.0.0.1 更改为 'localhost' 然后它工作正常.

                I am using Zend Framework to develop my application and I try to connect to a remote MySQL database in my LAN.

                The database connection settings in Zend is as follows:

                [GENERAL]
                db.adapter     = PDO_MYSQL
                db.params.host = 192.168.1.2
                db.params.port = 3306

                [LIVE:GENERAL] db.params.username = root db.params.password = ** db.params.dbname = djudd

                [DEVELOPMENT:GENERAL] db.params.username = root db.params.password = ** db.params.dbname = stellarengine

                I got the following error:

                Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[HY000] [2013] Lost connection to MySQL server at 'reading initial communication packet', system error: 111' in /usr/share/php/Zend/Db/Adapter/Pdo/Abstract.php:129 Stack trace: #0 /usr/share/php/Zend/Db/Adapter/Pdo/Abstract.php(129): PDO->__construct('mysql:host=192....', 'root', 'password', Array) #1 /usr/share/php/Zend/Db/Adapter/Pdo/Mysql.php(96): Zend_Db_Adapter_Pdo_Abstract->_connect() #2 /usr/share/php/Zend/Db/Adapter/Abstract.php(448): Zend_Db_Adapter_Pdo_Mysql->_connect() #3 /usr/share/php/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('DESCRIBEbny_c...', Array) #4 /usr/share/php/Zend/Db/Adapter/Pdo/Mysql.php(156): Zend_Db_Adapter_Pdo_Abstract->query('DESCRIBE bny_c...') #5 /usr/share/php/Zend/Db/Table/Abstract.php(823): Zend_Db_Adapter_Pdo_Mysql->describeTable('bny_core_module...', NULL) #6 /usr/share/php/Zend/Db/Table/Abstract.php(866): Zend_Db_Table_Abstract->_setupMetadata() #7 /usr/share/php/Zend/Db/Table/Abstract. in /usr/share/php/Zend/Db/Adapter/Pdo/Abstract.php on line 144

                Please help me to resolve this problem.

                解决方案

                Last time I had this type of error, I had to change my host from: 127.0.0.1 to 'localhost' and then it worked fine.

                这篇关于“与 MySQL 服务器的连接丢失"尝试连接到远程 MySQL 服务器时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                上一篇:如何比较两个 Zend_Date 对象的日期部分? 下一篇:鼠标悬停在网页上的链接上时如何隐藏浏览器状

                相关文章

                最新文章

                1. <small id='qGXwR'></small><noframes id='qGXwR'>

                2. <tfoot id='qGXwR'></tfoot>

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

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