MySQL Provides the Basic backup using command
mysqldump. This is powerful command and can take backup as a SQL CREATE TABLE and INSERT INTO TABLE commands. The output is in a text file and you can directly run this text file on the command MySQL command prompt for restoring the database.Backup Database :
Using mysqldump command is one of the way to take backup. This command runs through the windows command prompt or the Linux shell prompt. You can use the command as follows :
C:>\ mysqldump -p -u root --databases db_name > backup1.sql
This will prompt you for entering password for the user “root”. After successful authentication and authorization the SQL file “backup1.sql” will be created in your C:\ .
While having this command as a backup tool, MySQL provides the
LOCK TABLES , UNLOCK TABLES , DISABLE KEYS and ENABLE KEYS command . This helps you while restoring database.