Question: I am trying to start CakePHP. I made bookmarker and tested by command `bin\cake server`. It showed one error as connection to database could not be established: 

`SQLSTATE[HY000] [1045] Access denied for user 'my_app'@'localhost' (using password: YES).`

I read the `config/app.default.php` file. It says there is a database `my_app` and another database `test_myapp` with some users. I can not find these databases in phymyadmin in xampp. Am I supposed to create the named databases and users manually? I thought CakePHP should create these automatically. Or should I give names of databases etc. which I like and create the same.I'm using xampp with windows 7 and am very new to CakePHP.

Answer: 
**See in Mysql.php:**

class Mysql extends Driver
{

```
use MysqlDialectTrait;
use PDODriverTrait;

/**
 * Base configuration settings for MySQL driver
 *
 * @var array
 */
protected $_baseConfig = [
    'persistent' => true,
    'host' => 'localhost',
    'username' => 'root',
    'password' => '',
    'database' => 'cake',
    'port' => '3306',
    'flags' => [],
    'encoding' => 'utf8',
    'timezone' => null,
    'init' => [],
];

```

**Then in app.php write**

```
            'Datasources' => [
    'default' => [
        'className' => 'Cake\Database\Connection',
        'driver' => 'Cake\Database\Driver\Mysql',
        'persistent' => false,
        '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',
        'username' => 'root',
        'password' => '', 
        'database' => 'cake',
        'encoding' => 'utf8',
        'timezone' => 'UTC',
        'flags' => [],
        'cacheMetadata' => true,
        'log' => false,

...],

```

**In phpMyAdmin 
create cake database.
It's all.**
Error:

> 
> SQLSTATE[HY000] [1045] Access denied for user 'my\_app'@'localhost'
>  (using password: YES).
> 
> 
> 

Reason: 

> 
> No user id: "my\_app" with password: "secret" [or any other] set in config/app.php
>  file.
> 
> 
> 

Solution:

> 
> In case of WAMP, go to phpmyadmin page, then we can select cake\_cms
>  database -> privilage-> create user id and password, same as in config
>  file config/app.php, refresh the <http://localhost:8765/> page.
>  it should now show
> 
> 
> CakePHP is able to connect to the database.
> 
> 
>