I am trying to upgrade my current CakePHP 2.x application to 3.x.
I fixed problems with namespace and folder. Now I have problems with the database. On my test server, I created the same MySQL database and granted users access. Then I changed the configuration file config\app.php . But when I try to run my application, I get the following error. What is the problem? CakeFp seems to be trying to use Sqlite, but am I using MySQL?
Inside config\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' => 'nonstandard_port_number', 'username' => 'myuser', 'password' => 'mypass', 'database' => 'mydatabase', 'encoding' => 'utf8', 'timezone' => 'UTC', 'cacheMetadata' => true, /** * Set identifier quoting to true if you are using reserved words or * special characters in your table or column names. Enabling this * setting will result in queries built using the Query Builder having * identifiers quoted when creating SQL. It should be noted that this * decreases performance because each query needs to be traversed and * manipulated before being executed. */ 'quoteIdentifiers' => false, ], ],
Error
Error: [PDOException] SQLSTATE[HY000] [14] unable to open database file Request URL: /mycontroller/ Stack Trace:
source share