Hi all,
I have the same problem.
Configuration:
OS: Windows 7
using WAMP Server 3.2.0
PHP 7.4
MySql 8.0.18
CakePHP 4 installed using composer
Following the getting started guide i set up in MySql a database ‘cake_cms’
Added a user ‘cakephp’ with password ‘pswdcakephp’ granting him all privileges (I used PhpMyAdmin).
I edited the app.php and app_local.php files as follow (but i kept the original copies)
…
‘Datasources’ => [
‘default’ => [
//‘host’ => ‘localhost’,
/*
* CakePHP will use the default DB port based on the driver selected
* MySQL on MAMP uses port 8889, MAMP users will want to uncomment
* the following line and set the port accordingly
*/
//‘port’ => ‘non_standard_port_number’,
'className' => 'Cake\Database\Connection',
'driver' => 'Cake\Database\Driver\Mysql',
'persistent' => false,
'host' => 'localhost',
'username' => 'cakephp',
'password' => 'pswdcakephp',
'database' => 'cake_cms',
// Comment out the line below if you are using PostgreSQL
'encoding' => 'utf8mb4',
]
…
launched the developer server from command prompt and let it running
opening the page localhost:8765 green cookhats on all features but the database connection. The error is the same as @cavatoni reports:
CakePHP is NOT able to connect to the database.
Connection to Mysql could not be established: SQLSTATE[HY000] [1045] Access denied for user ‘cakephp’@‘localhost’ (using password: YES)
I also tried to edit just app.php or app_local.php but with the same error.
Each time I edited the files i also stopped restarted the developer server, cleared browser cache and closed it.
Also tried to restart WAMP.
I have noticed in WAMP control panel that MariaDB has a green mark on it (as if default) but MySql does not.
PHPInfo() works fine
I don’t know where the problem may be. Are there any checks I could do to narrow down the issue?
Thank you for your attention.