How to backup and restore a MariaDB database?

Backing up and restoring a MariaDB database can be done through the command line or using a database management tool.

Back up the MariaDB database:

  1. Back up the entire database using the mysqldump command.
mysqldump -u 用户名 -p 数据库名 > 备份文件名.sql
  1. Backup specific tables using the mysqldump command.
mysqldump -u 用户名 -p 数据库名 表名 > 备份文件名.sql

Restore MariaDB database:

  1. Restore the entire database using the MySQL command.
mysql -u 用户名 -p 数据库名 < 备份文件名.sql
  1. Restore a specific table using the MySQL command.
mysql -u 用户名 -p 数据库名 < 备份文件名.sql

Apart from using the command line, you can also use database management tools like phpMyAdmin, MySQL Workbench, etc. to backup and restore MariaDB databases. In these tools, there are usually buttons for backup and restore functions, where you can select the database or table to perform the operations by clicking on the buttons.

Leave a Reply 0

Your email address will not be published. Required fields are marked *


广告
Closing in 10 seconds
bannerAds