SUBSCRIBE VIA RSS


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.

Topics

TWITTER

Stack Overflow


The old fashioned way

RECENT TUNES

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 in  Web Development   |     |  delicious  Digg

Post a Comment

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word