CakePHP Database connection "Mysql" is missing, or could not be created CakePHP Database connection "Mysql" is missing, or could not be created php php

CakePHP Database connection "Mysql" is missing, or could not be created


Try adding the socket:

'unix_socket' => '/Applications/MAMP/tmp/mysql/mysql.sock',


An alternative to unix_socket (especially for OS X people) is to replace localhost with 127.0.0.1

Would be as Follows :

public $default = array(                'datasource' => 'Database/Mysql',                'persistent' => false,                'host' => '127.0.0.1',                'login' => 'user',                'password' => 'password',                'database' => 'database-name',                'prefix' => '',                'encoding' => 'utf8',        );


Edit php.ini and add:

extension=php_pdo_mysql.dll 

Then restart your web server