Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to back up mysql remotely and solve the coding problem

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article introduces the relevant knowledge of "how to back up mysql remotely and solve the coding problem". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

#! / bin/bashIP=192.168.0.198path=/usr/local/mysql/binvariables= `$ mysqlpath/mysql-uroot-pmima-h$IP-e "show variables like 'character\ _ set\ _%';" | awk'{print$2}'| sed-n'4' p` $mysqlpath/mysqldump-uroot-pmima-h$IP-default-character-set=$variables keyword_ad > / back/mysqldb/s198db/keyword_ad_$ (date +% Y%m%d) .sql $mysqlpath/mysqldump-uroot-pmima-h$IP-default-character-set=$variables mysql > / back/mysqldb/s198db/s198mysql_$ (date +% Y%m%d) .sql Sleep 180scd / back/mysqldb/s198db//bin/tar zcf keyword_ad_$ (date +% Y%m%d). Tar.gz keyword_ad_$ (date +% Y%m%d). Sql/bin/tar zcf s198mysqlroom$ (date +% Y%m%d). Tar.gz s198mysqlroom$ (date +% Y%m%d). Sqlsleep 60s/usr/bin/find / back/mysqldb/s198db/-name "* .tar.gz"-mtime + 5-exec rm-rf {}\ Sleep 60s/usr/bin/find / back/mysqldb/s198db/-name "* .sql"-mtime + 1-exec rm-rf {}\; "how to remotely back up mysql and solve the coding problem" ends here. Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

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.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report