-4

enter image description here

How can I solve this error?

At the time of cake bake.

This is my database configuration:

class DATABASE_CONFIG {
    public $default = array(
        'datasource' => 'Database/Mysql',
        'persistent' => false,
        'host' => 'localhost',
        'login' => 'root',
        'password' => '',
        'database' => 'cakephp2.9',
        'prefix' => '',
        //'encoding' => 'utf8',
    );
}

This is my database configuration class DATABASE_CONFIG { public $default = array( 'datasource' => 'Database/Mysql', 'persistent' => false, 'host' => 'localhost', 'login' => 'root', 'password' => '', 'database' => 'cakephp2.9', 'prefix' => '', //'encoding' => 'utf8', ); }

Bohemian
  • 412,405
  • 93
  • 575
  • 722
  • 1
    post here your DB configuration, mask your password – Salines Oct 08 '16 at 18:56
  • Post your code. – chris85 Oct 08 '16 at 19:18
  • This is my database configuration class DATABASE_CONFIG { public $default = array( 'datasource' => 'Database/Mysql', 'persistent' => false, 'host' => 'localhost', 'login' => 'root', 'password' => '', 'database' => 'cakephp2.9', 'prefix' => '', //'encoding' => 'utf8', ); } – Devendra Vastrakar Oct 09 '16 at 04:55
  • Please don't post code in comments, it's highly unreadable, instead edit your question where you can add it in a properly formatted fashion. – ndm Oct 09 '16 at 11:25

1 Answers1

0

CakePHP currently doesn't support database names with dots, as the routine that handles quoting names is being used for column names as well, in which dots are treated as separators for aliases and columns, ie for stuff like TableAlias.column_name, which is being converted to `TableAlias`.`column_name`, causing your database name to make it into the query as `cakephp2`.`9` which will of course fail.

Long story short, rename your database.

ndm
  • 59,784
  • 9
  • 71
  • 110