0

I'm trying to use the "cake bake" command with cakephp, but whenever i try to call that command i get:

What would you like to Bake? (D/M/V/C/P/F/T/Q)
> m
---------------------------------------------------------------
Bake Model
Path: C:\Program Files (x86)\EasyPHP-DevServer-14.1VC11\data\localweb\test\app\Model\
---------------------------------------------------------------
Error: Database connection "Mysql" is missing, or could not be created.
#0 C:\Program Files (x86)\EasyPHP-DevServer-14.1VC11\data\localweb\test\lib\Cake\Model\ConnectionManager.php(105): DboSource->__construct(Array)
#1 C:\Program Files (x86)\EasyPHP-DevServer-14.1VC11\data\localweb\test\lib\Cake\Console\Command\Task\ModelTask.php(948): ConnectionManager::getDataSource('defa
ult')
#2 C:\Program Files (x86)\EasyPHP-DevServer-14.1VC11\data\localweb\test\lib\Cake\Console\Command\Task\ModelTask.php(885): ModelTask->getAllTables(NULL)
#3 C:\Program Files (x86)\EasyPHP-DevServer-14.1VC11\data\localweb\test\lib\Cake\Console\Command\Task\ModelTask.php(975): ModelTask->listAll(NULL)
#4 C:\Program Files (x86)\EasyPHP-DevServer-14.1VC11\data\localweb\test\lib\Cake\Console\Command\Task\ModelTask.php(203): ModelTask->getName()
#5 C:\Program Files (x86)\EasyPHP-DevServer-14.1VC11\data\localweb\test\lib\Cake\Console\Command\Task\ModelTask.php(91): ModelTask->_interactive()
#6 C:\Program Files (x86)\EasyPHP-DevServer-14.1VC11\data\localweb\test\lib\Cake\Console\Command\BakeShell.php(109): ModelTask->execute()
#7 C:\Program Files (x86)\EasyPHP-DevServer-14.1VC11\data\localweb\test\lib\Cake\Console\Shell.php(440): BakeShell->main()
#8 C:\Program Files (x86)\EasyPHP-DevServer-14.1VC11\data\localweb\test\lib\Cake\Console\ShellDispatcher.php(209): Shell->runCommand(NULL, Array)
#9 C:\Program Files (x86)\EasyPHP-DevServer-14.1VC11\data\localweb\test\lib\Cake\Console\ShellDispatcher.php(66): ShellDispatcher->dispatch()
#10 C:\Program Files (x86)\EasyPHP-DevServer-14.1VC11\data\localweb\test\app\Console\cake.php(47): ShellDispatcher::run(Array)
#11 {main}

i have read and tried all the solutions i found on google and stackoverflow but none of them worked, and the connection is fine when i just implement my own model, controller and view.

Ouerghi Yassine
  • 1,835
  • 7
  • 43
  • 72

1 Answers1

0

It says there connection to Mysql is missing.

Make sure you have MySQL installed in your server first.

Then,have you changed your database configuration in /app/Config/database.php? You need to setup your database first.

If you already did that, have you test the connection? running localhost/yourwebfolder will display if you already set up CakePHP correctly before you can proceed with "baking"

Nizam
  • 505
  • 1
  • 8
  • 20