# Issue on baking process on linux (terminal)

**URL:** <https://discourse.cakephp.org/t/issue-on-baking-process-on-linux-terminal/2344>\
**Category:** Need Help\
**Created:** [April 4, 2017, 7:49am UTC](https://discourse.cakephp.org/t/issue-on-baking-process-on-linux-terminal/2344 "2017-04-04T07:49:20Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![ashishkurhadkar](https://avatars.discourse-cdn.com/v4/letter/a/c0e974/32.png) [@ashishkurhadkar](https://discourse.cakephp.org/u/ashishkurhadkar)\
**Post date:** [April 4, 2017, 7:49am UTC](https://discourse.cakephp.org/t/issue-on-baking-process-on-linux-terminal/2344/1 "2017-04-04T07:49:20Z")

</div>

Hi  
please help me…  
i am a beginner with cakephp3,  
i am facing issue with bake in cakephp 3 on linux , i have following issue at the time of enter following line on terminal (linux) " bin/cake bake all users "

mysystems:/opt/lampp/htdocs/myapps$ bin/cake bake all users

i have getting following error message on terminal (linux)  
…  
Welcome to CakePHP v3.3.15 Console  
App : src  
Path: /opt/lampp/htdocs/myapps/src/  
PHP : 5.5.9-1ubuntu4.21  
Bake All

One moment while associations are detected.  
Exception: SQLSTATE[28000] [1045] Access denied for user ‘root’@‘localhost’ (using password: NO) in [/opt/lampp/htdocs/myapps/vendor/cakephp/cakephp/src/Database/Driver/PDODriverTrait.php, line 48]  
2017-04-03 12:33:07 Error: [PDOException] SQLSTATE[28000] [1045] Access denied for user ‘root’@‘localhost’ (using password: NO)  
Stack Trace:  
#0 /opt/lampp/htdocs/myapps/vendor/cakephp/cakephp/src/Database/Driver/PDODriverTrait.php(48): PDO-\>\_\_construct(‘mysql:host=loca…’, ‘root’, ‘’, Array)  
#1 /opt/lampp/htdocs/myapps/vendor/cakephp/cakephp/src/Database/Driver/Mysql.php(104): Cake\Database\Driver\Mysql-\>\_connect(‘mysql:host=loca…’, Array)  
#2 /opt/lampp/htdocs/myapps/vendor/cakephp/cakephp/src/Database/Schema/BaseSchema.php(45): Cake\Database\Driver\Mysql-\>connect()  
#3 /opt/lampp/htdocs/myapps/vendor/cakephp/cakephp/src/Database/Dialect/MysqlDialectTrait.php(63): Cake\Database\Schema\BaseSchema-\>\_\_construct(Object(Cake\Database\Driver\Mysql))  
#4 /opt/lampp/htdocs/myapps/vendor/cakephp/cakephp/src/Database/Schema/Collection.php(52): Cake\Database\Driver\Mysql-\>schemaDialect()  
#5 /opt/lampp/htdocs/myapps/vendor/cakephp/cakephp/src/Database/Schema/CachedCollection.php(42): Cake\Database\Schema\Collection-\>\_\_construct(Object(Cake\Database\Connection))  
#6 /opt/lampp/htdocs/myapps/vendor/cakephp/cakephp/src/Database/Connection.php(322): Cake\Database\Schema\CachedCollection-\>\_\_construct(Object(Cake\Database\Connection), true)  
#7 /opt/lampp/htdocs/myapps/vendor/cakephp/bake/src/Shell/Task/ModelTask.php(951): Cake\Database\Connection-\>schemaCollection()  
#8 /opt/lampp/htdocs/myapps/vendor/cakephp/bake/src/Shell/Task/ModelTask.php(903): Bake\Shell\Task\ModelTask-\>\_getAllTables()  
#9 /opt/lampp/htdocs/myapps/vendor/cakephp/bake/src/Shell/Task/ModelTask.php(207): Bake\Shell\Task\ModelTask-\>listAll()  
#10 /opt/lampp/htdocs/myapps/vendor/cakephp/bake/src/Shell/Task/ModelTask.php(127): Bake\Shell\Task\ModelTask-\>getAssociations(Object(Cake\ORM\Table))  
#11 /opt/lampp/htdocs/myapps/vendor/cakephp/bake/src/Shell/Task/ModelTask.php(110): Bake\Shell\Task\ModelTask-\>getTableContext(Object(Cake\ORM\Table), ‘users’, ‘Users’)  
#12 /opt/lampp/htdocs/myapps/vendor/cakephp/bake/src/Shell/Task/ModelTask.php(97): Bake\Shell\Task\ModelTask-\>bake(‘Users’)  
#13 /opt/lampp/htdocs/myapps/vendor/cakephp/bake/src/Shell/BakeShell.php(257): Bake\Shell\Task\ModelTask-\>main(‘Users’)  
#14 /opt/lampp/htdocs/myapps/vendor/cakephp/cakephp/src/Collection/CollectionTrait.php(52): Bake\Shell\BakeShell-\>Bake\Shell{closure}(‘users’, 0)  
#15 /opt/lampp/htdocs/myapps/vendor/cakephp/bake/src/Shell/BakeShell.php(260): Cake\Collection\Collection-\>each(Object(Closure))  
#16 [internal function]: Bake\Shell\BakeShell-\>all(‘users’)  
#17 /opt/lampp/htdocs/myapps/vendor/cakephp/cakephp/src/Console/Shell.php(458): call\_user\_func\_array(Array, Array)  
#18 /opt/lampp/htdocs/myapps/vendor/cakephp/cakephp/src/Console/ShellDispatcher.php(227): Cake\Console\Shell-\>runCommand(Array, true, Array)  
#19 /opt/lampp/htdocs/myapps/vendor/cakephp/cakephp/src/Console/ShellDispatcher.php(182): Cake\Console\ShellDispatcher-\>\_dispatch(Array)  
#20 /opt/lampp/htdocs/myapps/vendor/cakephp/cakephp/src/Console/ShellDispatcher.php(128): Cake\Console\ShellDispatcher-\>dispatch(Array)  
#21 /opt/lampp/htdocs/myapps/bin/cake.php(34): Cake\Console\ShellDispatcher::run(Array)  
#22 {main}

Thank you

---

<div class="post-metadata">

**Author:** ![aavrug](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/aavrug/32/178_2.png) [@aavrug](https://discourse.cakephp.org/u/aavrug)\
**Post date:** [April 4, 2017, 8:25am UTC](https://discourse.cakephp.org/t/issue-on-baking-process-on-linux-terminal/2344/2 "2017-04-04T08:25:17Z")

</div>

Try `bin/cake server` and see the output, probably you haven’t configured `Datasources` properly in `app.php`.

---

<div class="post-metadata">

**Author:** ![ashishkurhadkar](https://avatars.discourse-cdn.com/v4/letter/a/c0e974/32.png) [@ashishkurhadkar](https://discourse.cakephp.org/u/ashishkurhadkar)\
**Post date:** [April 4, 2017, 9:56am UTC](https://discourse.cakephp.org/t/issue-on-baking-process-on-linux-terminal/2344/3 "2017-04-04T09:56:42Z")

</div>

thank for your feedback Gaurav,

but i have configured my database inside my folder structure  
which is look like this  
lampp/htdocs/myapps/config/app.php

app.php -  
…  
‘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\_php’,  
‘encoding’ =\> ‘utf8’,  
‘timezone’ =\> ‘UTC’,  
‘flags’ =\> [],  
‘cacheMetadata’ =\> true,  
‘log’ =\> false,

…

thank you

---

<div class="post-metadata">

**Author:** ![aavrug](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/aavrug/32/178_2.png) [@aavrug](https://discourse.cakephp.org/u/aavrug)\
**Post date:** [April 4, 2017, 10:05am UTC](https://discourse.cakephp.org/t/issue-on-baking-process-on-linux-terminal/2344/4 "2017-04-04T10:05:51Z")

</div>

I have not much idea about `LAMP` apllication but try to connect MySQL from terminal using `mysql -u root -p` and see what you get if you are able to login without any password then you have check your LAMP.

---

<div class="post-metadata">

**Author:** ![ashishkurhadkar](https://avatars.discourse-cdn.com/v4/letter/a/c0e974/32.png) [@ashishkurhadkar](https://discourse.cakephp.org/u/ashishkurhadkar)\
**Post date:** [April 4, 2017, 10:55am UTC](https://discourse.cakephp.org/t/issue-on-baking-process-on-linux-terminal/2344/5 "2017-04-04T10:55:28Z")

</div>

> [@aavrug](#):
>
> mysql -u root -p

Hi Gaurav, thank you for reply

## i did as per your guidance in terminal and i have getting following message “using without password”

## ERROR 1045 (28000): Access denied for user ‘root’@‘localhost’ (using password: NO) autoartsolutions1@autoartsolutions1:~$

thank you

---

<div class="post-metadata">

**Author:** ![ashishkurhadkar](https://avatars.discourse-cdn.com/v4/letter/a/c0e974/32.png) [@ashishkurhadkar](https://discourse.cakephp.org/u/ashishkurhadkar)\
**Post date:** [April 4, 2017, 11:10am UTC](https://discourse.cakephp.org/t/issue-on-baking-process-on-linux-terminal/2344/6 "2017-04-04T11:10:12Z")

</div>

> [@aavrug](#):
>
> login without any password

This means i am not able to login without password

---

<div class="post-metadata">

**Author:** ![aavrug](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/aavrug/32/178_2.png) [@aavrug](https://discourse.cakephp.org/u/aavrug)\
**Post date:** [April 4, 2017, 2:56pm UTC](https://discourse.cakephp.org/t/issue-on-baking-process-on-linux-terminal/2344/7 "2017-04-04T14:56:10Z")

</div>

So this means you have the wrong configuration in `app.php`. If you remember the MySQL password then set it or re-install MySQL.

---

<div class="post-metadata">

**Author:** ![ashishkurhadkar](https://avatars.discourse-cdn.com/v4/letter/a/c0e974/32.png) [@ashishkurhadkar](https://discourse.cakephp.org/u/ashishkurhadkar)\
**Post date:** [April 5, 2017, 3:54am UTC](https://discourse.cakephp.org/t/issue-on-baking-process-on-linux-terminal/2344/8 "2017-04-05T03:54:21Z")

</div>

> [@aavrug](#):
>
> re-install MySQL

ok thank you i will try…!

---

<div class="post-metadata">

**Author:** ![Shoeb](https://avatars.discourse-cdn.com/v4/letter/s/f6c823/32.png) [@Shoeb](https://discourse.cakephp.org/u/Shoeb)\
**Post date:** [April 6, 2017, 11:26am UTC](https://discourse.cakephp.org/t/issue-on-baking-process-on-linux-terminal/2344/9 "2017-04-06T11:26:46Z")

</div>

Hi ,  
I m facing issue last night as below.

Argument 1 passed to Cake\ORM\Table::save() must implement interface Cake\Datasource\EntityInterface, array given, called in /opt/lampp/htdocs/billingcake/src/Controller/BillsController.php on line 48

My code is,  
…

\<?php namespace App\Controller; use App\Controller\AppController; use Cake\ORM\Table; use Cake\Event\Event; use Cake\ORM\Query; use Cake\ORM\TableRegistry; use Cake\Routing\Router; use App\Model\Entity\Role; use Cake\Datasource\ConnectionManager; use Cake\View\Helper\HtmlHelper; use Cake\View\View; use Cake\Core\Configure; use Cake\Network\Exception\ForbiddenException; use Cake\Network\Exception\NotFoundException; use Cake\View\Exception\MissingTemplateException; use Cake\Collection\Collection; use Faker; class BillsController extends AppController { public function initialize() { parent::initialize(); $this-\>loadComponent('RequestHandler'); } public function index(){ $bill = $this-\>Bills-\>newEntity(); if ($this-\>request-\>is('post')) { $bill = $this-\>Bills-\>patchEntity($bill, $this-\>request-\>data); $bill = $this-\>request-\>data('product\_id'); $products = TableRegistry::get('Products'); $query = $products-\>find('list'); $bill = $query-\>toArray(); if ($this-\>Bills-\>save($bill)) { $this-\>Flash-\>success(\_\_('The billNo has been saved.')); return $this-\>redirect(['action' =\> 'index']); } $this-\>Flash-\>error(\_\_('The billNo could not be saved. Please, try again.')); } $this-\>set(compact('bill')); $this-\>set('\_serialize', ['bill']); } } ?\>

…

---

<div class="post-metadata">

**Author:** ![aavrug](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/aavrug/32/178_2.png) [@aavrug](https://discourse.cakephp.org/u/aavrug)\
**Post date:** [April 6, 2017, 11:40am UTC](https://discourse.cakephp.org/t/issue-on-baking-process-on-linux-terminal/2344/10 "2017-04-06T11:40:04Z")

</div>

> [@Shoeb](#):
>
> $bill = $this-\>request-\>data(‘product\_id’);
> 
> ```
> $products = TableRegistry::get('Products');
> $query = $products-&gt;find('list');
> 
> $bill = $query-&gt;toArray();
> 
> ```

Try to understand this part, you are doing wrong over here. Btw the original issue is different from yours so create a new one that will be a good idea.

---

<div class="post-metadata">

**Author:** ![Shoeb](https://avatars.discourse-cdn.com/v4/letter/s/f6c823/32.png) [@Shoeb](https://discourse.cakephp.org/u/Shoeb)\
**Post date:** [April 6, 2017, 12:05pm UTC](https://discourse.cakephp.org/t/issue-on-baking-process-on-linux-terminal/2344/11 "2017-04-06T12:05:14Z")

</div>

Thanx for your reply,

I want to achieve from one table record insert into another table (db). I have created one field for product name and i want to get the product\_id of particular product.  
I want matched the inserted product name which is equal to matched the product like as below

$\_POST[‘productname’] = $productname;

$sel\_query = "SELECT \* FROM PRODUCT\_TABLE WHRER producname=$productname ";  
$sql\_query = mysqli\_query($conn,$sel\_query);  
$row = mysqli\_fetch\_assoc($sql\_query);  
$product\_id = $row[‘ID’];

Sir, I want to make a above php code into cakephp 3 code…  
so how can i achieve this plz help me.

---

<div class="post-metadata">

**Author:** ![aavrug](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/aavrug/32/178_2.png) [@aavrug](https://discourse.cakephp.org/u/aavrug)\
**Post date:** [April 6, 2017, 12:10pm UTC](https://discourse.cakephp.org/t/issue-on-baking-process-on-linux-terminal/2344/12 "2017-04-06T12:10:43Z")

</div>

Sorry, but this doesn’t make any sense to me. If you are trying to set any field to any entity just use that in object format something like `$bill->product_id = $productId`.

---

<div class="post-metadata">

**Author:** ![Shoeb](https://avatars.discourse-cdn.com/v4/letter/s/f6c823/32.png) [@Shoeb](https://discourse.cakephp.org/u/Shoeb)\
**Post date:** [April 27, 2017, 5:11am UTC](https://discourse.cakephp.org/t/issue-on-baking-process-on-linux-terminal/2344/13 "2017-04-27T05:11:58Z")

</div>

Hi,

How to upload my cakephp3.4 project on online server using file zila ?Please help me sir

---

<div class="post-metadata">

**Author:** ![aavrug](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/aavrug/32/178_2.png) [@aavrug](https://discourse.cakephp.org/u/aavrug)\
**Post date:** [April 27, 2017, 5:42am UTC](https://discourse.cakephp.org/t/issue-on-baking-process-on-linux-terminal/2344/14 "2017-04-27T05:42:05Z")

</div>

Please go to the Larry Page. Also If you are asking some question which is not related to the current issue, then create a new issue don’t start with some random topics.  
Join the channels for easy or quick questions. Btw what you are asking is not an issue!
