PHP Logo I’m fiddling with the Symfony Demo Application for an article I’m researching and I wanted to use it with MySQL instead of SQLite (which it defaults to). In order to make this change I had to do the following:

1. Change .env to Use MySQL

Open your .env file and find the following line:

DATABASE_URL=sqlite:///%kernel.project_dir%/var/data/blog.sqlite

And change it to the following:

DATABASE_URL=mysql://username:password@127.0.0.1:3306/databasename

2. Reset the Database

$ php bin/console doctrine:schema:create
$ php bin/console doctrine:fixtures:load

Like this post? Don't forget to follow us on Twitter and Facebook for updates.