Home Ask Login Register

Developers Planet

Your answer is one click away!

user3547469 February 2016

I can't switch the database on Symfony 2.7

I am creating a Symfony 2.7 project and I would like to change the parameters.yml document.

My problem is that I worked in a local host with Xampp and, now, I need to link it to an online database. Sure, I first changed the name on parameters.yml as indicated in the photo.

    database_driver: pdo_mysql
    database_host: 127.0.0.
    database_port: null
    database_name: qvd913
    database_user: root
    database_password: null
    locale: en
    secret: secret_value_for_symfony_demo_application_ruben

The old name is correolectronico and the new name is qvd913. Symfony is not use this new value qvd913, take the old configuration. When I try the following:

php app/console doctrine:database:create                                                        

I receive the following error:

Could not create database correoElectronico for connection named default.

An exception occurred while executing 'CREATE DATABASE correoElectronico':

SQLSTATE[HY000]: General error: 1007 Can't create database 'correoelectronico'; database exists


elkorchi anas February 2016

  1. Try to clear your cache files
  2. You need also to add those parameters in the parameters.yml.dist if you are deploying this app somewhere.

Post Status

Asked in February 2016
Viewed 1,960 times
Voted 12
Answered 1 times


Leave an answer

Quote of the day: live life