Cakephp Mysql Database connection missing error

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

This is the error I am getting…

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

1 Like

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

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!

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) ?

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

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