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

Kar*_*yan 4 php mysql zend-framework

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

Zend中的数据库连接设置如下:

__PRE__

我收到以下错误:

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 ...',数组)#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

请帮我解决这个问题.

pdo*_*naj 7

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