Docker uses the mysqldump command to back up and export mysql data in the project

Docker uses the mysqldump command to back up and export mysql data in the project

mysqldump command

Introduction: A database backup program

Format: mysqldump [options] [db_name [tbl_name ...]] Description: The mysqldump client utility performs a logical backup, generating a set of SQL statements that can be executed to reproduce the original database object definitions and table data. It dumps one or more MySQL databases for backup or transfer to another SQL server. The mysqldump command can also generate output in CSV, other delimited text, or XML formats.

The following figure shows the renamed image name uoj. Now we need to export mysql in this image.

Run the following command:

docker exec -it uoj mysqldump -uroot -proot app_uoj233 >/data/database_bak/app_uoj233.sql

#Note: uoj is the image name -u is the database username -p is the database password app_uoj233 is the data name in the project, /data/database_bak/ is the export directory, app_uoj233.sql is the exported sql file, i.e. the database 

Summarize

The above is what I introduced to you. I hope it will be helpful to you. If you have any questions, please leave me a message and I will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website!
If you find this article helpful, please feel free to reprint it and please indicate the source. Thank you!

You may also be interested in:
  • mysqldump parameters you may not know
  • Implementation of MySQL5.7 mysqldump backup and recovery
  • Detailed explanation of the idea of ​​using mysqldump+expect+crontab to implement mysql periodic cold backup in linux
  • Summary of MySql import and export methods using mysqldump
  • Detailed explanation of the use of MySQL mysqldump
  • How to use mysqldump for full and point-in-time backups
  • MySQL data migration using MySQLdump command
  • PHP scheduled backup MySQL and mysqldump syntax parameters detailed
  • Detailed explanation of how to use the mysql backup script mysqldump
  • Detailed explanation of Linux mysqldump exporting database, data, and table structure
  • Detailed discussion on the issue of mysqldump data export
  • Use of MySQL official export tool mysqlpump

<<:  MySQL 8.0.16 installation and configuration tutorial under CentOS7

>>:  MySQL 8.0.16 installation and configuration method graphic tutorial under Windows

Recommend

Web Design Tutorial (4): About Materials and Expressions

<br />Previous Web Design Tutorial: Web Desi...

Knowledge about MySQL Memory storage engine

Knowledge points about Memory storage engine The ...

jQuery implements employee management registration page

This article example shares the specific code of ...

Centos7 installation and configuration of Mysql5.7

Step 1: Get the MySQL YUM source Go to the MySQL ...

Use CSS to easily implement some frequently appearing weird buttons

background In the group, some students will ask r...

Conditional comment style writing method and sample code

As front-end engineers, IE must be familiar to us...

Django online deployment method of Apache

environment: 1. Windows Server 2016 Datacenter 64...

Methods and steps for deploying GitLab environment based on Docker

Note: It is recommended that the virtual machine ...

Detailed explanation of generic cases in TypeScript

Definition of Generics // Requirement 1: Generics...

Based on the special characters in the URL escape encoding

Table of contents Special characters in URLs URL ...

How to modify the scroll bar style in Vue

Table of contents First of all, you need to know ...

How to Rename a Group of Files at Once on Linux

In Linux, we usually use the mv command to rename...

MySQL time types and modes details

Table of contents 1. MySQL time type 2. Check the...