Advertisement: Over 100,000 Jobs Worldwide. Click here to find one for you.

MySQL FAQs
FAQs Categories
Client Server Commands
Database Structure
Table Types or Storage Engines
Indexes
SQL Statements
Table Joins
Funtions and Operators
Tricky Select Queries
Speed Up Queries
Data Back Up
General Questions
Errors
Send This Page to Friend
Enter Friend's Email
Enter Your Email
http://www.kareerlinks.com/jobs/skill/MySQL
 
Home / Data Back Up / Export Data / Question No: 81

How to take dump of the database?

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?

Answer No: 81

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:

1. C:\AppServ>MySQL>
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

Comments
Add Comments
Found a bug? Or do you have a better solution for this? Feel free to leave a message:
Leave a comment
Your Name: Your Email Address (optional):
Comment:


Related MySQL FAQs to the Above FAQ

How-to-use-SELECT-INTO-OUTFILE-statement-to-export-data How to use SELECT INTO OUTFILE statement to export data?

How-to-export-table-data-to-text-file-with-SELECT-INTO-OUTFILE-statement How to export table data to text file with SELECT INTO OUTFILE statement?

How-to-export-table-data-to-Microsoft-Excel-with-SELECT-INTO-OUTFILE-statement How to export table data to Microsoft Excel with SELECT INTO OUTFILE statement?

How-to-use-mysqldump-to-export-data How to use mysqldump to export data?

How-to-take-dump-of-database-without-its-data How to take dump of database without its data?