# Cakephp Mysql Database connection missing error

**URL:** <https://discourse.cakephp.org/t/cakephp-mysql-database-connection-missing-error/6212>\
**Category:** Need Help\
**Created:** [June 4, 2019, 10:30am UTC](https://discourse.cakephp.org/t/cakephp-mysql-database-connection-missing-error/6212 "2019-06-04T10:30:42Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![pawanlakhera](https://avatars.discourse-cdn.com/v4/letter/p/7ba0ec/32.png) [@pawanlakhera](https://discourse.cakephp.org/u/pawanlakhera)\
**Post date:** [June 4, 2019, 10:30am UTC](https://discourse.cakephp.org/t/cakephp-mysql-database-connection-missing-error/6212/1 "2019-06-04T10:30:42Z")

</div>

Database connection “Mysql” is missing, or could not be created in Linux. I am using Cakephp 2.7.8. I am running the below command to update my ACO. It is working fine in my local system(Windows) but is not working on the production Server(Linux)

I have installed all the drivers like Pdo,php5-mysql. I am running the below command.

**/usr/bin/php /var/www/html/website/app/app/Console/cake.php AclExtras.AclExtras aco\_sync**

I am getting the following error: **Database connection “Mysql” is missing, or could not be created**

It should work on the production Server(Linux) also as it is working in the local(Windows) system.

You can find the phpinfo() html code in the following link : [PHP INFO FILE](https://drive.google.com/file/d/1t3SoaBHyYwCMGlj922_h-6UPg-gqZYQt/view)

This is the error I am getting…

 ![info_error](https://canada1.discourse-cdn.com/flex029/uploads/cakephp/original/2X/1/13b6f89e31d1fffc22376975a2ac8e3831caff2f.png)

---

<div class="post-metadata">

**Author:** ![FinlayDaG33k](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/finlaydag33k/32/1049_2.png) [@FinlayDaG33k](https://discourse.cakephp.org/u/FinlayDaG33k)\
**Post date:** [June 4, 2019, 2:46pm UTC](https://discourse.cakephp.org/t/cakephp-mysql-database-connection-missing-error/6212/2 "2019-06-04T14:46:01Z")

</div>

Sounds like you have not set it up in the `app.php` (if that’s a thing with Cake 2)?

---

<div class="post-metadata">

**Author:** ![pawanlakhera](https://avatars.discourse-cdn.com/v4/letter/p/7ba0ec/32.png) [@pawanlakhera](https://discourse.cakephp.org/u/pawanlakhera)\
**Post date:** [June 4, 2019, 2:52pm UTC](https://discourse.cakephp.org/t/cakephp-mysql-database-connection-missing-error/6212/3 "2019-06-04T14:52:23Z")

</div>

I don’t think so…It is working fine in my windows pc.

---

<div class="post-metadata">

**Author:** ![Baku](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/baku/32/1416_2.png) [@Baku](https://discourse.cakephp.org/u/Baku)\
**Post date:** [June 4, 2019, 2:53pm UTC](https://discourse.cakephp.org/t/cakephp-mysql-database-connection-missing-error/6212/4 "2019-06-04T14:53:47Z")

</div>

Did u try to put connection at other cake project at **nameofcakeproject/config/app.php**?

if not, u need to see this part at **app.php** :

`/* * 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' => 'username of connection to database', 'password' => '', 'database' => 'name of database at phpmyadmin or other?',`

that’s the thing works on Cakephp 3.7 and newer.

I dont know if Cakephp 2 it will works with composer for creating projects of cakephp 2 (the version of 3 always works better), just try it.  
Have a good day!

---

<div class="post-metadata">

**Author:** ![pawanlakhera](https://avatars.discourse-cdn.com/v4/letter/p/7ba0ec/32.png) [@pawanlakhera](https://discourse.cakephp.org/u/pawanlakhera)\
**Post date:** [June 4, 2019, 3:01pm UTC](https://discourse.cakephp.org/t/cakephp-mysql-database-connection-missing-error/6212/5 "2019-06-04T15:01:55Z")

</div>

> [@Baku](#):
>
> always works better), just try it.

Actually the project is developed using cakephp 2.7 and it is my company’s project and I am not allowed to update the cake version.

Is there someone in this group who can help in this problem(cake 2.7) ?

---

<div class="post-metadata">

**Author:** ![Baku](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/baku/32/1416_2.png) [@Baku](https://discourse.cakephp.org/u/Baku)\
**Post date:** [June 4, 2019, 3:40pm UTC](https://discourse.cakephp.org/t/cakephp-mysql-database-connection-missing-error/6212/6 "2019-06-04T15:40:17Z")

</div>

oh, that explains. Only Cake 2.X…try to check this part of book. I hope that will help u and works better.

[Cakephp 2.X database configuration](https://book.cakephp.org/2.0/en/getting-started.html)

I’d imagine about this error, check it well the name of database or wrong username/password.  
Later!
