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

Implement a simple data response system

Table of contents 1. Dep 2. Understand obverser 3...

Advanced crawler - Use of Scrapy_splash component for JS automatic rendering

Table of contents 1. What is scrapy_splash? 2. Th...

Notes on configuring multiple proxies using vue projects

In the development process of Vue project, for th...

JS generates unique ID methods: UUID and NanoID

Table of contents 1. Why NanoID is replacing UUID...

5 things to note when writing React components using hooks

Table of contents 01. Use useState when render is...

Detailed explanation of the use of filter properties in CSS3

Recently, when I was modifying the intranet porta...

How to use async await elegantly in JS

Table of contents jQuery's $.ajax The beginni...

Two ways to build Docker images

Table of contents Update the image from an existi...

MySQL 8.0 DDL atomicity feature and implementation principle

1. Overview of DDL Atomicity Before 8.0, there wa...

mysql5.6.zip format compressed version installation graphic tutorial

Preface: MySQL is a relational database managemen...

How to use Vue's idea to encapsulate a Storage

Table of contents background Function Purpose Ide...

How to set static IP in CentOS7 on VirtualBox6 and what to note

Install CentOS 7 after installing VirtualBox. I w...

MySQL InnoDB transaction lock source code analysis

Table of contents 1. Lock and Latch 2. Repeatable...

Simple web page code used in NetEase blog

How to use the code in NetEase Blog: First log in...