• Home
  • Server Management
  • Home
  • Server Management
home/Knowledge Base/MySQL/How to Back Up and Restore MySQL Databases the Right Way

How to Back Up and Restore MySQL Databases the Right Way

5 views 0 May 7, 2025 admin

Backup with mysqldump

Single Database

mysqldump -u root -p mydb > mydb_backup.sql

All Databases

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

For large databases, add --single-transaction --quick

Restore a Backup

mysql -u root -p mydb < mydb_backup.sql

Automate Backups with Cron

Example:

0 2 * * * /usr/bin/mysqldump -u root -ppassword mydb > /backups/mydb_$(date +\%F).sql
Tags:MySQL RestoreMySQL backup

Was this helpful?

Yes  No
Related Articles
  • How to Fix “Too Many Connections” Error in MySQL

Didn't find your answer? Contact Us

Leave A Comment Cancel reply

MySQL
  • How to Back Up and Restore MySQL Databases the Right Way
  • How to Fix “Too Many Connections” Error in MySQL
All Categories
  • Grafana
  • Kubernetes
  • Kafka
  • Nginx
  • Linux
  • MySQL

  How to Fix “Too Many Connections” Error in MySQL

Manual
  • We we are
  • Contact us
  • Suppliers
Support
  • Live chat
  • Knowledge Base
  • Blog
Security
  • Report Copyright
  • Trademark
  • Security Issue
Manual Head Office
Phone : 765 987-7765
Toll free : 1 999 654-98729
Fax : 250 684-29865
Emergency Help Desk: 7pm-2pm

Center street, 18th floor, New York, NY 1007