CakePHP Bake Shell错误:数据库连接“Mysql”缺失或无法创建 [英] CakePHP Bake Shell Error: Database connection “Mysql” is missing, or could not be created
问题描述
我在这里有一个烘焙问题。
我读过类似问题的以前的答案,但是解决方案似乎不适用这里。
I have an issue here with baking.
I've read the previous answers to similar questions, but the solutions seem to not apply here.
我无法烘焙,因为我收到的错误是:数据库连接Mysql缺失或无法创建
I can't bake because the error I receive is: Database connection "Mysql" is missing, or could not be created
如果我运行其中php
,它读取的PHP是MAMP中的正确路径。
If I run which php
the PHP it's reading is the correct path within MAMP.
如果我检查PDO模块:
If I check the PDO modules:
php -i | grep "PDO"
PDO
PDO support => enabled
PDO drivers => sqlite, pgsql, mysql
PDO Driver for MySQL => enabled
PDO Driver for PostgreSQL => enabled
PDO Driver for SQLite 3.x => enabled
我的应用程序(或者我到目前为止已经完成的)数据库。
My application (or what I've completed on it so far) has no trouble connecting to the database.
我完全卡住了。网络上的所有答案都指向PDO未启用,或者PHP的路径不正确,但这两者都不适用于我的情况。
I'm completely stuck. All answers around the web point to PDO not being enabled, or the incorrect path for PHP, but neither of those apply in my case.
我愿意为您提供
推荐答案
可能是用户名/密码错误或数据库名称拼写错误。我曾经有一个以空格开头的数据库(名称)。我花了大约2个小时才找到...
Maybe a wrong username / password or misspelled database name. I once had a database (name) beginning with a space. It took me about 2 hours before I found out...
您可能想使用纯PHP,请参阅。
You may want to check the database connection using plain PHP, see.
这篇关于CakePHP Bake Shell错误:数据库连接“Mysql”缺失或无法创建的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!