Subscribe to our feed

Symfony Experts

Symfony Experts
If you have an urgent question for a symfony-related issue, this is the place to ask.


Stack Overflow

The old fashioned way


April 24, 2007 – 10:02am MySQL data dump

Although I love the batch process for loading data into the database within a symfony project, sometimes it can be a bit slow if the dataset is large. I find myself reinitializing the database often while I test, not because I change the schema or add new data, but because I want to reset the data back to its initial state. For this, I run the batch process once loading the data from the yaml fixtures, and then do an SQL dump that will run much, much faster from here on out.

mysqldump -e --add-drop-table -u root -p db_name > ./data/sql/latestdump.sql

To repopulate the database with this dump file:

mysql -u root -p dbname < data/sql/latestdump.sql
Posted by in  Web Development   |  

Comments are closed.