当我想用wamp服务器创建一个新的数据库时,出现了这个错误。我该如何解决
$应用程序/控制台doctrine:database:create无法为名为default的连接创建数据库“symfony”驱动程序中发生异常:sqlstate[hy000][14]无法打开数据库文件
parameters.yml:
database_driver: pdo_sqlite
database_host: 127.0.0.1
database_port: null
database_name: symfony
database_user: root
database_password: null
database_path: '%kernel.root_dir%/data/blog.sqlite'
mailer_transport: smtp
mailer_host: 127.0.0.1
mailer_user: null
mailer_password: null
locale: en
secret: secret_value_for_symfony_demo_application
参数.yml.dist:
# This file defines the canonical configuration parameters of the application.
# Symfony uses this file as a template to generate the real app/config/parameters.yml
# used by the application.
# See
http://symfony.com/doc/current/best_practices/configuration.html#canonical-parameters
parameters:
# this demo application uses an embedded SQLite database to simplify setup.
# in a real Symfony application you probably will use a MySQL or PostgreSQL database
database_driver: pdo_sqlite
database_host: 127.0.0.1
database_port: ~
database_name: symfony
database_user: root
database_password: ~
# the 'database_path' is only used for SQLite type databases
database_path: %kernel.root_dir%/data/blog.sqlite
# Uncomment these lines to use a MySQL database instead of SQLite:
#
# database_driver: pdo_mysql
# database_host: 127.0.0.1
# database_port: null
# database_name: symfony_demo
# database_user: root
# database_password: null
#
# You can even create the database and load the sample data from the command line:
#
# $ cd your-symfony-project/
# $ php app/console doctrine:database:create
# $ php app/console doctrine:schema:create
# $ php app/console doctrine:fixtures:load
# If you don't use a real mail server, you can send emails via your Gmail account.
# see http://symfony.com/doc/current/cookbook/email/gmail.html
mailer_transport: smtp
mailer_host: 127.0.0.1
mailer_user: ~
mailer_password: ~
# The code of the default language used by the application ('en' = English)
locale: en
# The 'secret' value is a random string of characters, numbers and symbols
# used internally by Symfony in several places (CSRF tokens, URI signing,
# 'Remember Me' functionality, etc.)
# see: http://symfony.com/doc/current/reference/configuration/framework.html#secret
secret: 'secret_value_for_symfony_demo_application'
2条答案
按热度按时间lx0bsm1f1#
出现此消息的一个原因是用户无法在
%kernel.root_dir%/data/
文件夹。检查是否可以在此文件夹中创建文件。c3frrgcw2#
我在config.yml@markus中有这个