[英]CakePHP Bake Error: Database connection “Mysql” is missing, or could not be created
I'm looking for some help to get rid of this error. 我正在寻找一些帮助摆脱此错误的方法。 As i'm running mac os x 10.5 I had to install A newer version of php to support pdo.
当我运行Mac OS X 10.5时,我必须安装更新版本的php以支持pdo。 I did this using Marc Liyanage's installer package.
我使用Marc Liyanage的安装程序包来完成此操作。
The problem I'm having now is that using php from the command line is invoking the default apple php, not the pdo enabled version causing bake to fail. 我现在遇到的问题是从命令行使用php会调用默认的Apple php,而不是启用了pdo的版本导致烘焙失败。
How can I get the bake command to use the correct version of php on my system? 如何获得bake命令以在系统上使用正确版本的php?
Many Thanks 非常感谢
Ralph 拉尔夫
you could specify the path to the new php.. ? 您可以指定新php的路径。
/path/to/new/php/php script_to_run.php / path / to / new / php / php script_to_run.php
There may be an alternatives package under osx as well where you can specify which versions of which apps you can use. osx下可能还有一个替代软件包,您可以在其中指定可以使用哪些应用程序的版本。
I was getting the following error while trying to bake v2.3.1 尝试烘焙v2.3.1时出现以下错误
Warning Error: PDO::__construct(): [2002] No such file or directory (trying to connect via unix:///var/mysql/mysql.sock) in [/Library/WebServer/third-party/frameworks/cake_2.3.1/lib/Cake/Model/Datasource/Database/Mysql.php, line 158]
警告错误:PDO :: __ construct():[2002] [/ Library / WebServer / third-party / frameworks / cake_2中没有这样的文件或目录(试图通过unix:///var/mysql/mysql.sock连接) .3.1 / lib / Cake / Model / Datasource / Database / Mysql.php,第158行]
Error: Database connection "Mysql" is missing, or could not be created. 错误:缺少数据库连接“ Mysql”,或无法创建。
Fixed the issue by modifying pdo_mysql.default_socket in php.ini to point to right socket file path. 通过修改php.ini中的pdo_mysql.default_socket以指向正确的套接字文件路径来解决此问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.