Take the 2-minute tour ×
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. It's 100% free, no registration required.

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 stackoverflow.com Sep 6 '12 at 20:36

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

5 Answers 5

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
    
This will get the .sql for all the db's that I have. So I have to specify a specific db name to get the back up. After I can use the .sql file that I have saved to create a db with the data that I had! –  seeker Sep 6 '12 at 12:27
1  
It works fine! Thank you very much –  seeker Sep 6 '12 at 12:28
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.

URL

share|improve this answer
    
Thanks for the clear explanation Ravi! -vijay –  seeker Sep 6 '12 at 12:29

You can use mysqldump — a Database Backup Program to store database into SQL file, and use mysql — the MySQL Command-Line Tool to restore database from the dump file.

Also, you can use Database Backup and Restore features in dbForge Studio for MySQL (GUI or command line).

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

 
discard

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