In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces the docker environment database backup example analysis, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let Xiaobian take you to understand.
Posgresql backup / restore
1. Backup
DATE= `date +% Y% m% dmurf% H% M`Back _ DATA=xxapp-data-$ {DATE} .out # the name of the backup file is set here to prevent repetition of docker exec pg-db pg_dumpall-U postgres > ${BACK_DATA} # pg-db is the docker name of the database
two。 Restore
Docker cp ${BACK_DATA} pg-db:/tmpdocker exec pg-db psql-U postgres-f / tmp/$ {BACK_DATA} postgresmysql backup / restore
1. Backup
DATE= `date +% Y% m% dmurf% H% M`Back _ DATA=xxapp-data-$ {DATE} .sql # mysql-db is the docker name of the database, xxxpwd is the password of the root user, and app-db is the name of the data to be backed up, docker exec mysql-db mysqldump-uroot-pxxxpwd-- databases app-db > ${BACK_DATA}
two。 Restore the following ${BACK_DATA} to be replaced with the name of the actual generated file
Docker cp ${BACK_DATA} mysql-db:/tmp docker exec-it mysql-db mysql- uroot-pxxxpwd mysql > source / tmp/$ {BACK_DATA} .sqlmysql >\ qBye
Supplement
Postgresql is to back up all databases, mysql is to back up a database.
Thank you for reading this article carefully. I hope the article "sample Analysis of Database backup in docker Environment" shared by the editor will be helpful to you. At the same time, I also hope you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.