cakephp error. Connection to database …not …: Access denied for user 'my_app'@'localhost' (using password: YES)









up vote
3
down vote

favorite
1












I am trying to start CakePHP. I made bookmarker and tested by command bincake 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.










share|improve this question























  • test_myapp is a test database setup by cakephp itself
    – Keyur Padalia
    May 14 '15 at 15:46














up vote
3
down vote

favorite
1












I am trying to start CakePHP. I made bookmarker and tested by command bincake 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.










share|improve this question























  • test_myapp is a test database setup by cakephp itself
    – Keyur Padalia
    May 14 '15 at 15:46












up vote
3
down vote

favorite
1









up vote
3
down vote

favorite
1






1





I am trying to start CakePHP. I made bookmarker and tested by command bincake 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.










share|improve this question















I am trying to start CakePHP. I made bookmarker and tested by command bincake 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.







database cakephp default cakephp-3.0






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited May 17 '15 at 5:23









Mureinik

176k21127195




176k21127195










asked May 14 '15 at 12:43









Ajay Dhar

26113




26113











  • test_myapp is a test database setup by cakephp itself
    – Keyur Padalia
    May 14 '15 at 15:46
















  • test_myapp is a test database setup by cakephp itself
    – Keyur Padalia
    May 14 '15 at 15:46















test_myapp is a test database setup by cakephp itself
– Keyur Padalia
May 14 '15 at 15:46




test_myapp is a test database setup by cakephp itself
– Keyur Padalia
May 14 '15 at 15:46












3 Answers
3






active

oldest

votes

















up vote
5
down vote



accepted










Cake will not create the database or database user for you. You need to create them yourself and then match these database credentials into the db config file. Your datasource in app/Config/app.php file should look something similar to:



'Datasources' => [
'default' => [
'className' => 'CakeDatabaseConnection',
'driver' => 'CakeDatabaseDriverMysql',
'persistent' => false,
'host' => 'localhost',
'username' => 'my_db_user',
'password' => 'my_db_user_password',
'database' => 'cake_database_name',
'encoding' => 'utf8',
'timezone' => 'UTC',
'cacheMetadata' => true,
]
],


In this example you would have to create a database named: cake_database_name, and then add a database user named my_db_user with the password of my_db_user_password.






share|improve this answer


















  • 1




    Thanks a lot McWayWeb, specially for the detailed way you answered. You make it very simple. You judged my level of ability accurately and gave a simple explaination!
    – Ajay Dhar
    May 15 '15 at 9:15






  • 1




    I added a database for cake and another for test. I created a user also with a few priviliages. I changed the values in config.app.php as per the 2 databases I created. Still bincake server command gives the error Access denied for user 'my_app'@'localhost' (using password: YES). It should not even use the name 'my_app' since I changed it in config/app.php but it persists. Please help.
    – Ajay Dhar
    May 19 '15 at 13:19










  • I also make 4 tables in the first database as advised by cake docs.
    – Ajay Dhar
    May 19 '15 at 13:44










  • I got it now. I was editing the wrong app.php. I now edited the higher app.php and it is working nicely. It connects to the database. I am so happy. Thanks a lot.
    – Ajay Dhar
    May 19 '15 at 13:53










  • how to mark your answer as the right one and best?
    – Ajay Dhar
    May 19 '15 at 14:00

















up vote
1
down vote













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' => 'CakeDatabaseConnection',
'driver' => 'CakeDatabaseDriverMysql',
'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.






share|improve this answer



























    up vote
    0
    down vote













    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.







    share|improve this answer






















      Your Answer






      StackExchange.ifUsing("editor", function ()
      StackExchange.using("externalEditor", function ()
      StackExchange.using("snippets", function ()
      StackExchange.snippets.init();
      );
      );
      , "code-snippets");

      StackExchange.ready(function()
      var channelOptions =
      tags: "".split(" "),
      id: "1"
      ;
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function()
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled)
      StackExchange.using("snippets", function()
      createEditor();
      );

      else
      createEditor();

      );

      function createEditor()
      StackExchange.prepareEditor(
      heartbeatType: 'answer',
      convertImagesToLinks: true,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: 10,
      bindNavPrevention: true,
      postfix: "",
      imageUploader:
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      ,
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      );



      );













      draft saved

      draft discarded


















      StackExchange.ready(
      function ()
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f30237702%2fcakephp-error-connection-to-database-not-access-denied-for-user-my-app%23new-answer', 'question_page');

      );

      Post as a guest















      Required, but never shown

























      3 Answers
      3






      active

      oldest

      votes








      3 Answers
      3






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes








      up vote
      5
      down vote



      accepted










      Cake will not create the database or database user for you. You need to create them yourself and then match these database credentials into the db config file. Your datasource in app/Config/app.php file should look something similar to:



      'Datasources' => [
      'default' => [
      'className' => 'CakeDatabaseConnection',
      'driver' => 'CakeDatabaseDriverMysql',
      'persistent' => false,
      'host' => 'localhost',
      'username' => 'my_db_user',
      'password' => 'my_db_user_password',
      'database' => 'cake_database_name',
      'encoding' => 'utf8',
      'timezone' => 'UTC',
      'cacheMetadata' => true,
      ]
      ],


      In this example you would have to create a database named: cake_database_name, and then add a database user named my_db_user with the password of my_db_user_password.






      share|improve this answer


















      • 1




        Thanks a lot McWayWeb, specially for the detailed way you answered. You make it very simple. You judged my level of ability accurately and gave a simple explaination!
        – Ajay Dhar
        May 15 '15 at 9:15






      • 1




        I added a database for cake and another for test. I created a user also with a few priviliages. I changed the values in config.app.php as per the 2 databases I created. Still bincake server command gives the error Access denied for user 'my_app'@'localhost' (using password: YES). It should not even use the name 'my_app' since I changed it in config/app.php but it persists. Please help.
        – Ajay Dhar
        May 19 '15 at 13:19










      • I also make 4 tables in the first database as advised by cake docs.
        – Ajay Dhar
        May 19 '15 at 13:44










      • I got it now. I was editing the wrong app.php. I now edited the higher app.php and it is working nicely. It connects to the database. I am so happy. Thanks a lot.
        – Ajay Dhar
        May 19 '15 at 13:53










      • how to mark your answer as the right one and best?
        – Ajay Dhar
        May 19 '15 at 14:00














      up vote
      5
      down vote



      accepted










      Cake will not create the database or database user for you. You need to create them yourself and then match these database credentials into the db config file. Your datasource in app/Config/app.php file should look something similar to:



      'Datasources' => [
      'default' => [
      'className' => 'CakeDatabaseConnection',
      'driver' => 'CakeDatabaseDriverMysql',
      'persistent' => false,
      'host' => 'localhost',
      'username' => 'my_db_user',
      'password' => 'my_db_user_password',
      'database' => 'cake_database_name',
      'encoding' => 'utf8',
      'timezone' => 'UTC',
      'cacheMetadata' => true,
      ]
      ],


      In this example you would have to create a database named: cake_database_name, and then add a database user named my_db_user with the password of my_db_user_password.






      share|improve this answer


















      • 1




        Thanks a lot McWayWeb, specially for the detailed way you answered. You make it very simple. You judged my level of ability accurately and gave a simple explaination!
        – Ajay Dhar
        May 15 '15 at 9:15






      • 1




        I added a database for cake and another for test. I created a user also with a few priviliages. I changed the values in config.app.php as per the 2 databases I created. Still bincake server command gives the error Access denied for user 'my_app'@'localhost' (using password: YES). It should not even use the name 'my_app' since I changed it in config/app.php but it persists. Please help.
        – Ajay Dhar
        May 19 '15 at 13:19










      • I also make 4 tables in the first database as advised by cake docs.
        – Ajay Dhar
        May 19 '15 at 13:44










      • I got it now. I was editing the wrong app.php. I now edited the higher app.php and it is working nicely. It connects to the database. I am so happy. Thanks a lot.
        – Ajay Dhar
        May 19 '15 at 13:53










      • how to mark your answer as the right one and best?
        – Ajay Dhar
        May 19 '15 at 14:00












      up vote
      5
      down vote



      accepted







      up vote
      5
      down vote



      accepted






      Cake will not create the database or database user for you. You need to create them yourself and then match these database credentials into the db config file. Your datasource in app/Config/app.php file should look something similar to:



      'Datasources' => [
      'default' => [
      'className' => 'CakeDatabaseConnection',
      'driver' => 'CakeDatabaseDriverMysql',
      'persistent' => false,
      'host' => 'localhost',
      'username' => 'my_db_user',
      'password' => 'my_db_user_password',
      'database' => 'cake_database_name',
      'encoding' => 'utf8',
      'timezone' => 'UTC',
      'cacheMetadata' => true,
      ]
      ],


      In this example you would have to create a database named: cake_database_name, and then add a database user named my_db_user with the password of my_db_user_password.






      share|improve this answer














      Cake will not create the database or database user for you. You need to create them yourself and then match these database credentials into the db config file. Your datasource in app/Config/app.php file should look something similar to:



      'Datasources' => [
      'default' => [
      'className' => 'CakeDatabaseConnection',
      'driver' => 'CakeDatabaseDriverMysql',
      'persistent' => false,
      'host' => 'localhost',
      'username' => 'my_db_user',
      'password' => 'my_db_user_password',
      'database' => 'cake_database_name',
      'encoding' => 'utf8',
      'timezone' => 'UTC',
      'cacheMetadata' => true,
      ]
      ],


      In this example you would have to create a database named: cake_database_name, and then add a database user named my_db_user with the password of my_db_user_password.







      share|improve this answer














      share|improve this answer



      share|improve this answer








      edited May 14 '15 at 21:21

























      answered May 14 '15 at 20:24









      McWayWeb

      1,01411329




      1,01411329







      • 1




        Thanks a lot McWayWeb, specially for the detailed way you answered. You make it very simple. You judged my level of ability accurately and gave a simple explaination!
        – Ajay Dhar
        May 15 '15 at 9:15






      • 1




        I added a database for cake and another for test. I created a user also with a few priviliages. I changed the values in config.app.php as per the 2 databases I created. Still bincake server command gives the error Access denied for user 'my_app'@'localhost' (using password: YES). It should not even use the name 'my_app' since I changed it in config/app.php but it persists. Please help.
        – Ajay Dhar
        May 19 '15 at 13:19










      • I also make 4 tables in the first database as advised by cake docs.
        – Ajay Dhar
        May 19 '15 at 13:44










      • I got it now. I was editing the wrong app.php. I now edited the higher app.php and it is working nicely. It connects to the database. I am so happy. Thanks a lot.
        – Ajay Dhar
        May 19 '15 at 13:53










      • how to mark your answer as the right one and best?
        – Ajay Dhar
        May 19 '15 at 14:00












      • 1




        Thanks a lot McWayWeb, specially for the detailed way you answered. You make it very simple. You judged my level of ability accurately and gave a simple explaination!
        – Ajay Dhar
        May 15 '15 at 9:15






      • 1




        I added a database for cake and another for test. I created a user also with a few priviliages. I changed the values in config.app.php as per the 2 databases I created. Still bincake server command gives the error Access denied for user 'my_app'@'localhost' (using password: YES). It should not even use the name 'my_app' since I changed it in config/app.php but it persists. Please help.
        – Ajay Dhar
        May 19 '15 at 13:19










      • I also make 4 tables in the first database as advised by cake docs.
        – Ajay Dhar
        May 19 '15 at 13:44










      • I got it now. I was editing the wrong app.php. I now edited the higher app.php and it is working nicely. It connects to the database. I am so happy. Thanks a lot.
        – Ajay Dhar
        May 19 '15 at 13:53










      • how to mark your answer as the right one and best?
        – Ajay Dhar
        May 19 '15 at 14:00







      1




      1




      Thanks a lot McWayWeb, specially for the detailed way you answered. You make it very simple. You judged my level of ability accurately and gave a simple explaination!
      – Ajay Dhar
      May 15 '15 at 9:15




      Thanks a lot McWayWeb, specially for the detailed way you answered. You make it very simple. You judged my level of ability accurately and gave a simple explaination!
      – Ajay Dhar
      May 15 '15 at 9:15




      1




      1




      I added a database for cake and another for test. I created a user also with a few priviliages. I changed the values in config.app.php as per the 2 databases I created. Still bincake server command gives the error Access denied for user 'my_app'@'localhost' (using password: YES). It should not even use the name 'my_app' since I changed it in config/app.php but it persists. Please help.
      – Ajay Dhar
      May 19 '15 at 13:19




      I added a database for cake and another for test. I created a user also with a few priviliages. I changed the values in config.app.php as per the 2 databases I created. Still bincake server command gives the error Access denied for user 'my_app'@'localhost' (using password: YES). It should not even use the name 'my_app' since I changed it in config/app.php but it persists. Please help.
      – Ajay Dhar
      May 19 '15 at 13:19












      I also make 4 tables in the first database as advised by cake docs.
      – Ajay Dhar
      May 19 '15 at 13:44




      I also make 4 tables in the first database as advised by cake docs.
      – Ajay Dhar
      May 19 '15 at 13:44












      I got it now. I was editing the wrong app.php. I now edited the higher app.php and it is working nicely. It connects to the database. I am so happy. Thanks a lot.
      – Ajay Dhar
      May 19 '15 at 13:53




      I got it now. I was editing the wrong app.php. I now edited the higher app.php and it is working nicely. It connects to the database. I am so happy. Thanks a lot.
      – Ajay Dhar
      May 19 '15 at 13:53












      how to mark your answer as the right one and best?
      – Ajay Dhar
      May 19 '15 at 14:00




      how to mark your answer as the right one and best?
      – Ajay Dhar
      May 19 '15 at 14:00












      up vote
      1
      down vote













      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' => 'CakeDatabaseConnection',
      'driver' => 'CakeDatabaseDriverMysql',
      '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.






      share|improve this answer
























        up vote
        1
        down vote













        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' => 'CakeDatabaseConnection',
        'driver' => 'CakeDatabaseDriverMysql',
        '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.






        share|improve this answer






















          up vote
          1
          down vote










          up vote
          1
          down vote









          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' => 'CakeDatabaseConnection',
          'driver' => 'CakeDatabaseDriverMysql',
          '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.






          share|improve this 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' => 'CakeDatabaseConnection',
          'driver' => 'CakeDatabaseDriverMysql',
          '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.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered May 2 '16 at 12:36









          user6281223

          111




          111




















              up vote
              0
              down vote













              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.







              share|improve this answer


























                up vote
                0
                down vote













                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.







                share|improve this answer
























                  up vote
                  0
                  down vote










                  up vote
                  0
                  down vote









                  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.







                  share|improve this answer














                  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.








                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited Nov 10 at 4:10

























                  answered Nov 10 at 2:51









                  Pankaj

                  7518




                  7518



























                      draft saved

                      draft discarded
















































                      Thanks for contributing an answer to Stack Overflow!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid


                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.

                      To learn more, see our tips on writing great answers.





                      Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                      Please pay close attention to the following guidance:


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid


                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.

                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function ()
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f30237702%2fcakephp-error-connection-to-database-not-access-denied-for-user-my-app%23new-answer', 'question_page');

                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      Use pre created SQLite database for Android project in kotlin

                      Darth Vader #20

                      Ondo