2

Hi I am building a desktop app using phpdesktop. I ran into this problem Error: Database connection "Sqlite" is missing, or could not be created. when using cake bake. I am able to connect to db and fetch a data-row using Controllers.

My major worry is if this problem is going to affect storing and retrieving data or any other process that is related to db functionality for the application.

I have searched the forums for info with and tried most of the recommendations but none of them seams to work. I will appreciate if anyone has information on how to solve this problem.

I a using windows and php 5.4.33. There is a variable in php.ini sqlite3.extension_dir I have tried setting this to full path and also "." or "./" none of these produced a desire result.

RavatSinh Sisodiya
  • 1,596
  • 1
  • 20
  • 42
Koji D'infinte
  • 1,309
  • 12
  • 20
  • Try google: https://www.google.com/search?q=Error%3A+%22Database+connection%22+%22Sqlite%22+%22is+missing%22%2C+%22or+could+not+be+created.%22&btnG=Search – Czarek Tomczak Jan 13 '17 at 13:43

2 Answers2

2

I was able to solve the problem. It turns out that cake bake uses the current working directory for file references. In my case, I launched bake from the app directory so the database file has to be referenced relative to this folder.

My db was located in app/data so the right configuration to use was as shown:

    public $default = array(
        'datasource' => 'Database/Sqlite',
        'persistent' => false,
        'database' => 'data/app_db.sqlite',
        'encoding' => 'utf-8',
    );
RavatSinh Sisodiya
  • 1,596
  • 1
  • 20
  • 42
0

It may be caused due to wrong username / password or misspelled database name.

Abhay
  • 6,410
  • 4
  • 26
  • 34