CakePHP 3.3 cannot connect to database

Hi,

I’m new to CakePHP. Recently I installed Apache 2.4, MySQL 5.7, and CakePHP 3.3.1 in Windows 10. When I started Apache and pointed browser to localhost:8080/CakePHP3, the page displayed an error message:

Database

CakePHP is NOT able to connect to the database.

Datasource class cakephp\cakephp\src\Database\Connection could not be found.

Can anyone advise me what is going wrong here and how to correct it?

thanks and appreciate your response

Can you connect with phpmyadmin or another like I use sqlyog? If you can connect there, make sure you have the config in cake set up correctly.

Hi Jim, thanks for hints! My issue was resolved by correcting the data source configuration in app.php. “cakephp\cakephp\src\Database\Connection” is an actual path, the correct mappings are:

‘className’ => ‘Cake\Database\Connection’,
‘driver’ => ‘Cake\Database\Driver\Mysql’,