Mondoze Knowledge Base

Search our articles or browse by category below

Database using Mysqldump

Last modified: October 7, 2022
You are here:
Estimated reading time: < 1 min

Database using MySQLdump

Below are mysqldump commands for backup and restore mysql database:

WINDOWS:

Backup:
C:\mysql\bin> mysqldump -u username -p password database > dumbfile.sql

Restore:
C:\mysql\bin>mysql -u username -p password database < dumpfile.sql


UNIX / LINUX

Method A (followed by the user database username and password)
=======
Backup:

mysqldump -u username -p password database > dumbfile.sql

Restore:
mysql -u username -p password database < dumbfile.sql

Method B (backup and restore with root access)
========
Backup:
mysqldump databasename > dumpfile.sql

Restore:
mysql newdatabasename < dumpfile.sql

Notes:
– dumbfile.sql contains SQL command for creating tables and data. (CREATE,INSERT,DROP etc.) Learn more

Was this article helpful?
Dislike 0
Views: 34