自动将MySQLdump转储到本地计算机(Windows)

编程入门 行业动态 更新时间:2024-10-25 18:26:31
本文介绍了自动将MySQLdump转储到本地计算机(Windows)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我想将mysqldump从远程主机自动化到我的计算机,但我不知道该怎么做.

I'd like to automate a mysqldump to my computer from a remote host, and I cannot figure out how to do it.

我想我应该通过SSH隧道运行mysqldump,但是由于我的本地计算机是Windows XP计算机,这一点变得很复杂.我正在用腻子像这样打开隧道:

I suppose that I should run a mysqldump through an SSH tunnel, but this becomes complicated by the fact that my local computer is a Windows XP machine. I'm using putty to open a tunnel like so:

putty -load "[my saved session]" -L [localport]:localhost:3306 -N

注意:我不能只是远程连接到mysql服务器.

Note: I can't just connect to the mysql server remotely.

推荐答案

而不是PuTTY,请下载命令行版本plink.exe.然后,使用相同的连接参数,您可以通过plink运行mysqldump并将输出保存在本地.可从与PuTTY相同的下载页面获得PLink.

Instead of PuTTY, download the command line version plink.exe. Then using the same connection parameters you can run the mysqldump via plink and save the output locally. PLink is available from the same download page as PuTTY.

# setup the tunnel with plink plink -load "[my saved session]" -L [localport]:localhost:3306 # Mysqldump your local port, redirected to outfile mysqldump --port=[localport] -h localhost -uuser -ppassword dbname > outfile

www.chiark.greenend.uk /~sgtatham/putty/download.html

或者,另一种方法是在与plink相同的命令行中执行mysqldump,将其重定向到本地计算机上的outfile.

Or, another method would be to execute mysqldump in the same command line as plink, redirecting it to outfile on the local machine.

plink -load "[my saved session]" mysqldump -uuser -ppassword dbname > outfile

更多推荐

自动将MySQLdump转储到本地计算机(Windows)

本文发布于:2023-10-15 01:16:03,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1492812.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:计算机   MySQLdump   转储到   Windows

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!