Mysql database backup and restore by mysqldump
In this guide, we will explain how to backup and restore a MySQL database using mysqldump, ensuring your data is secure and easily recoverable.
Last updated
In this guide, we will explain how to backup and restore a MySQL database using mysqldump, ensuring your data is secure and easily recoverable.
Last updated
MySQL is a premier open-source Relational Database Management System (RDBMS) acclaimed for its ability to efficiently store, manage, and retrieve structured information. It serves as the backbone for a myriad of applications, ranging from modest personal projects to complex, high-traffic internet sites and sophisticated enterprise solutions.
Key highlights of MySQL include its high performance, robust reliability, seamless scalability, and user-friendly nature. Moreover, it boasts wide compatibility across leading operating systems such as Linux, macOS, Windows, and Ubuntu, making it a versatile solution for any environment.
Require two Ubuntu 22.04
mysql-server-8.0
Install MySQL by typing the following command:
To secure the installation, MySQL inside-
Using testing database-
Create testing_table in the testing_database
Insert data to testing_table
show testing_table
Dump all data without locking but with transaction-ensured data integrity by [--single-transaction] option:-
Dump specific database:-
For restoring data from backup on another host, run as follows. Before restoring, transfer dump data to the target host with [rsync] or [scp] and so on.
Copy these mysql_dump.sql another machine:
$ sftp root@another_machine_ip
Go to another server machine: