I want to take dump of the my database alongwith its primary/foreign key constraints etc. How to take dump of the database in MySQL having such conditions?
MySQL provides mysqldump utility, which is simple to use. Go to command line and stay there at where MySQL is installed. As with me, I am using Windows and at my system MySQL is installed at C:\AppServ\MySQL. So you may do the following to take dump of the database using mysqldump utility:
2. Run mysqldump utility giving required options like mysqldump --password=password --user=user_name db_name > db_name_dump.sql
Take an example looks like below at command prompt:
C:\AppServ\MySQL>mysqldump --password=root --user=root test > test_dump.sql