Zend Server CE连接到mysql [英] connecing to mysql with Zend Server CE

查看:87
本文介绍了Zend Server CE连接到mysql的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近在我的Opensuse开发服务器上安装了Zend Server Community Edtion,它运行良好. 唯一的问题是它没有连接到MySql服务器!它不断抛出错误:

I have recently installed Zend Server Community Edtion on my Opensuse development server and it worked fine. The only problem is that it is not connecting to my MySql server!! It keeps throwing in the error:

Message: PDO Connection Error: SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

在/tmp/中查找,是的,没有mysql.sock.但是我仍然不知道该怎么办.我需要更改一些apache配置文件吗?还是更改mysql配置?

Lookud up in /tmp/ and yes there is no mysql.sock. But i still have no clue what to do.. Do i need to change some apache config file? Or change mysql config?

我真的需要帮助,因为我有一个大项目要进行,我已经搜索过google,但没有任何运气.

I really need help because I have a big project to work on, I have already searched google but without any luck.

这是您的完整堆栈跟踪记录:

Here is the complete stack trace for your intrest:

#0 /srv/www/zend/apache2/htdocs/zend.athand.eu/library/Doctrine/Connection/Mysql.php(101): Doctrine_Connection->connect()
#1 /srv/www/zend/apache2/htdocs/zend.athand.eu/library/Doctrine/Connection.php(1001): Doctrine_Connection_Mysql->connect()
#2 /srv/www/zend/apache2/htdocs/zend.athand.eu/library/Doctrine/Query/Abstract.php(976): Doctrine_Connection->execute('SELECT t.id AS ...', Array)
#3 /srv/www/zend/apache2/htdocs/zend.athand.eu/library/Doctrine/Query/Abstract.php(1026): Doctrine_Query_Abstract->_execute(Array)
#4 /srv/www/zend/apache2/htdocs/zend.athand.eu/application/models/Text.php(25): Doctrine_Query_Abstract->execute()
#5 /srv/www/zend/apache2/htdocs/zend.athand.eu/library/App/View/Helper/Text.php(27): Application_Model_Text->findText('introText')
#6 [internal function]: App_View_Helper_Text->Text('introText')
#7 /srv/www/zend/share/ZendFramework/library/Zend/View/Abstract.php(342): call_user_func_array(Array, Array)
#8 /srv/www/zend/apache2/htdocs/zend.athand.eu/application/modules/pwc/views/scripts/login/password.phtml(6): Zend_View_Abstract->__call('text', Array)
#9 /srv/www/zend/apache2/htdocs/zend.athand.eu/application/modules/pwc/views/scripts/login/password.phtml(6): Zend_View->text('introText')
#10 /srv/www/zend/share/ZendFramework/library/Zend/View.php(108): include('/srv/www/zend/a...')
#11 /srv/www/zend/share/ZendFramework/library/Zend/View/Abstract.php(880): Zend_View->_run('/srv/www/zend/a...')
#12 /srv/www/zend/share/ZendFramework/library/Zend/Controller/Action/Helper/ViewRenderer.php(897): Zend_View_Abstract->render('login/password....')
#13 /srv/www/zend/share/ZendFramework/library/Zend/Controller/Action/Helper/ViewRenderer.php(918): Zend_Controller_Action_Helper_ViewRenderer->renderScript('login/password....', NULL)
#14 /srv/www/zend/share/ZendFramework/library/Zend/Controller/Action/Helper/ViewRenderer.php(957): Zend_Controller_Action_Helper_ViewRenderer->render()
#15 /srv/www/zend/share/ZendFramework/library/Zend/Controller/Action/HelperBroker.php(277): Zend_Controller_Action_Helper_ViewRenderer->postDispatch()
#16 /srv/www/zend/share/ZendFramework/library/Zend/Controller/Action.php(523): Zend_Controller_Action_HelperBroker->notifyPostDispatch()
#17 /srv/www/zend/share/ZendFramework/library/Zend/Controller/Dispatcher/Standard.php(295): Zend_Controller_Action->dispatch('passwordAction')
#18 /srv/www/zend/share/ZendFramework/library/Zend/Controller/Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))
#19 /srv/www/zend/share/ZendFramework/library/Zend/Application/Bootstrap/Bootstrap.php(97): Zend_Controller_Front->dispatch()
#20 /srv/www/zend/share/ZendFramework/library/Zend/Application.php(366): Zend_Application_Bootstrap_Bootstrap->run()
#21 /srv/www/zend/apache2/htdocs/zend.athand.eu/public/pwc/index.php(106): Zend_Application->run()
#22 {main}

如果您需要更多信息,我们很乐意为您提供

If you need any more information I'd be happy to give you them

推荐答案

该错误消息表示mysql.sock位于其他位置.这在Zend CE,MAMP,XAMPP等应用程序中确实经常发生,您应该查看mysql.sock所在的位置(可能在Zend CE安装文件夹中的tmp文件夹中),然后必须在代码中指定此新位置,通常可以为套接字位置指定一个可选参数.

The error message means that the mysql.sock is located elsewhere. This happens really frequently with app like Zend CE, MAMP, XAMPP, etc you should take a look where mysql.sock is located (maybe in a tmp folder in Zend CE installation folder) and then you have to specify this new location in your code, you can generally specify an optional param for the socket location.

这篇关于Zend Server CE连接到mysql的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆