Dumping data with mysqldump could be tricky with all the available options. If you are looking to backup all the data and triggers, here's the set of options you need.
backup complete database
mysqldump -u myusername --password=mypassword --databases mydatabase --skip-opt --routines > dump.sqlif you only want to backup the triggers and functions etc then you could use
mysqldump -u myusername --password=mypassword --database mydatabase --skip-opt --routines --no-create-info --no-data --no-create-db > no-data-dump.sql
Use --opt if you want to include the auto_increment as well in the create command.
No comments:
Post a Comment