I am working on my test application in symfony2 with sqlite. I have install symfony2 and trying to setup with sqlite, I have create 'data' folder under 'src/test' test namespaces, but when I run command
app/console doctrine:database:create
Its giving error :
Could not create database for connection named data/ak.db
SQLSTATE[HY000] [14] unable to open database file
My Parameter.yml settings are :
parameters:
database_driver: pdo_sqlite
database_host: localhost
database_port: null
database_name: ak.db
database_user: root
database_password: null
mailer_transport: smtp
mailer_host: localhost
mailer_user: null
mailer_password: null
locale: en
secret: b4289c0b750d5c5b573788d79c4e1d130380ff7d
database_path: data/ak.db
and config.yml :
# Doctrine Configuration
doctrine:
dbal:
driver: %database_driver%
host: %database_host%
port: %database_port%
dbname: %database_name%
user: %database_user%
password: %database_password%
path: %database_path%
charset: UTF8
The database 'path' parameter has to list the full path to the database. In your case, you can do:
doctrine:
dbal:
path: %kernel.root_dir%/src/test/%database_path%
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With