Backup MySQL database on WAMP

Backup MySQL database on WAMP

In this tutorial we are going to learn how to back up our MySQL database in WAMP using the mysqldump command.

mysqldump command is used to export a database or all databases that resides on your MySQL Server. The exported file has an extension of .sql which commonly consists of SQL commands to create a database, create tables and insert records into tables.

Here’s how to create a backup file using the mysqldump command

  1. Click Start > Run then type cmd and hit enter.
  2. Syntax: C:\wamp\bin\mysql\[mysql version]\bin\mysqldump -u root -p [database_name] > [path where you want to put the file and the filename]
  3. Type this command: C:\wamp\bin\mysql\mysql5.5.24\bin\mysqldump -u root -p dk> c:\dk.sql

Where:
mysql.5.5.24 is the version of your mysql database.

dk is the name of the database you want to backup.

c:\dk.sql is the path and filename of the backup file.

Back up all of the databases on server

C:\wamp\bin\mysql\mysql5.5.24\bin\mysqldump–all-databases -u root -p> c:\dk.sql

If prompted by a password, type your mysql password.

Note: this command will store all of the databases in a single file named dk.sql.

Backup multiple databases

C:\wamp\bin\mysql\mysql5.5.24\bin\mysqldump–database -u root –p dk employee> c:\dk.sql

Note: this command will back up the database dk and employee database and store the contents in dk.sql file.

Backup is important because it helps you creates backup of the databases so you can prevent data loss and damage caused by disk failures, virus infection and other potentially damaging events.

, , ,

Post navigation

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.