MySQL + SQL · Lesson 104

mysqldump Backup Command

What is mysqldump?

mysqldump is a command-line tool that exports a database (or table) into a single .sql file you can back up or move to another server.

Common Commands

# whole database
mysqldump -u root -p school > school.sql

# one table only
mysqldump -u root -p school students > students.sql

# all databases
mysqldump -u root -p --all-databases > all.sql

Summary

  • mysqldump exports databases/tables to .sql files.
  • Use it for backups and moving data between servers.
🔗

Share this topic with a friend

यह topic किसी दोस्त को भेजें

Found it useful? Send it to a classmate learning the same thing.

अच्छा लगा? जो दोस्त यही सीख रहा है, उसे भेज दीजिए।

WhatsApp