Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a database which has my data's that I have been working for months. Now, I want to delete that db. What concern's me is that the data's that I have might come in handy in the future development. So I want to get a backup for this db, where I can get all the data's and table structures in this db as a backup and then delete it.

I am confused about how to do this.

share|improve this question

migrated from Sep 6 '12 at 20:36

This question came from our site for professional and enthusiast programmers.

Have a look at the mysql_dump dump utility (MySQL docu).

Alternatively you can use the Export function of PhpMyAdmin to generate a SQL file containing all you structure and data.

share|improve this answer

mysqldump database_name should do the trick.

share|improve this answer
up vote 1 down vote accepted

Have a look at this one.

 mysqldump -u [username] -p [password] [databasename] > [backupfile.sql]    
    [username] - this is your database username
    [password] - this is the password for your database
    [databasename] - the name of your database
    [backupfile.sql] - the file to which the backup should be written.


share|improve this answer

And it would even be much simpler if you have xampp or wampp,because all you would need to do is to export the whole database

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.