PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Friday, February 18, 2022

[FIXED] Missing Database Connection cakephp

 February 18, 2022     cakephp, mysql, xampp     No comments   

Issue

I can't connect my cakephp application with mysql database. when I run it in localhost it works but when I move to a remote server it doesn't and it gives this error:

Missing Database Connection

I tried these solutions but it was vain in all cases:

  • Commented out : skip-networking.
  • edited the LocationMatch bloc in the htppd-xamp.conf yet still no changes

Below is the code of the connection to the DB:

<?php
class DATABASE_CONFIG {

    public $default = array(
        'datasource' => 'Database/Mysql',
        'persistent' => false,
        'host' => '51.254.205.243',
        'login' => 'login',
        'password' => 'pwd',
        'database' => 'db',
        'prefix' => '',
        'encoding' => 'utf-8'
    );
}

If you really know what is going on and how to fix this issue, I would be grateful to learn from you.

Regards


Solution

Change host to 127.0.0.1 / localhost



Answered By - P.Banerjee
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing