LinuxSEE

  • 首页
  • APACHE
  • CACTI
  • DNS_BIND
  • IPTABLES
  • LINUX杂记
  • LINUX系统性能分析
  • LOG_SERVER
  • LVS+KEEPALIVED
  • MFS
  • MYSQL
  • PHP
  • POSTFIX
  • RSYNC
  • SHELL
  • SQUID
  • VPN

用ssh-tunnel模式加密mysql主从复制

分类:MYSQL日期:2011-05-18作者:雨尚

用ssh-tunnel模式加密mysql主从复制

原理:在mysql从服务器上通过ssh建立隧道,以本机8888端口为例,连接mysql主服务器3306端口,同时在mysql主服务器添加主从复制账号,在mysql从服务器上通过连接本机127.0.0.1:8888(这里不能是localhost)端口进行复制;

具体操作:

mysql从(ssh -f user@master_ip -L 8888:master_ip:3306 -N) ——>
mysql从(change master to master_host='127.0.0.1', master_port='8888', master_user='user', master_password='pass',MASTER_LOG_FILE='logbin.000001', MASTER_LOG_POS=804;)

ssh以隧道模式从本机8888端口连接mysql主服务器3306端口,mysql从再通过本机127.0.0.1:8888连接mysql主:3306端口

mysql从——>ssh:8888——>mysql主3306

转载请注明来自:LinuxSEE

Tags: MYSQL , ssh
  • 上一篇:scp和rsync传输带宽控制
  • 下一篇:Mysql主从从级联复制(A->B->C)
29条评论
  1. Xadrian 说:

    What a joy to find someone else who thnkis this way.

    POST:2011-06-13 13:42 回复
    • Trevon 说:

      I thank you humbly for sahirng your wisdom JJWY

      POST:2011-06-25 08:31 回复
      • Marni 说:

        Hey, klielr job on that one you guys!

        POST:2011-09-06 10:19 回复
        • Lucka 说:

          Phneoemnal breakdown of the topic, you should write for me too!

          POST:2011-10-14 02:53 回复
      • Wanita 说:

        Alright algriht alright that’s exactly what I needed!

        POST:2011-09-07 19:18 回复
        • Koyie 说:

          Grazi for mkiang it nice and EZ.

          POST:2011-10-14 18:10 回复
        • Bert 说:

          I’m so glad I found my slouiton online.

          POST:2011-10-17 00:36 回复
    • Mellie 说:

      That’s not just logic. That’s rlealy sensible.

      POST:2011-06-26 15:32 回复
      • Tayten 说:

        Very true! Makes a change to see semoone spell it out like that. :)

        POST:2011-09-06 16:23 回复
        • Githa 说:

          You are so aewsmoe for helping me solve this mystery.

          POST:2011-10-14 17:25 回复
          • Dianelis 说:

            That’s what we’ve all been wiaitng for! Great posting!

            POST:2012-02-24 02:14
        • Verle 说:

          Mighty useful. Make no mtisake, I appreciate it.

          POST:2011-10-17 00:18 回复
      • Makailee 说:

        Extremely helpful article, pealse write more.

        POST:2011-09-07 14:48 回复
        • Keischa 说:

          Holy Toledo, so glad I ccliked on this site first!

          POST:2011-10-14 12:10 回复
        • Carlynda 说:

          I’m out of league here. Too much brain power on dspilay!

          POST:2011-10-17 01:12 回复
  2. happyday67 说:

    I saw something else with this on another blog. Youve obviously spent a while with this. Well done!

    POST:2011-09-17 04:19 回复
    • Makaela 说:

      I actually found this more eenrtatining than James Joyce.

      POST:2011-10-15 02:41 回复
    • Rangle 说:

      Mighty usufel. Make no mistake, I appreciate it.

      POST:2011-10-16 23:14 回复
  3. Craig Jurin 说:

    Hello. fantastic job. I did not imagine this. This is a remarkable story. Thanks!

    POST:2011-12-19 19:24 回复
  4. Mauro Tancer 说:

    Youre so cool! I dont suppose Ive learn something like this before. So nice to find any person with some original thoughts on this subject. realy thank you for beginning this up. this web site is something that’s needed on the web, someone with a bit of originality. useful job for bringing one thing new to the web!

    POST:2011-12-21 05:34 回复
  5. Lemuel Budin 说:

    When I originally commented I clicked the “Notify me when new comments are added” checkbox and now each time a comment is added I get three emails with the same comment. Is there any way you can remove people from that service? Thanks a lot!

    POST:2011-12-22 09:33 回复
  6. Charles Magda 说:

    Just desire to say your article is as surprising. The clearness in your post is simply excellent and i can assume you are an expert on this subject. Fine with your permission allow me to grab your RSS feed to keep updated with forthcoming post. Thanks a million and please carry on the gratifying work.

    POST:2011-12-25 16:05 回复
  7. Ronald Riecke 说:

    Marvelous items coming from everyone, individual. Advised Looking at you need to Overdue Commence Solutions I had have an understanding of your current activities earlier than and you just are merely particularly amazing. I like what you possess bought in this article, certainly such as whatever you say as well as the way people state this. You actually help it become satisfying so you nonetheless take care of to help keep that prudent. Determine delay to learn even more through everyone. This is generally a fantastic Encouraged Browsing quick Slowed Begin Expert services informations.

    POST:2012-01-04 17:29 回复
    • Tony 说:

      Yours is a celevr way of thinking about it.

      POST:2012-02-24 05:31 回复
  8. Soo Fitton 说:

    Hello, you may have below an attractive good stuff now! I truly have a quickly written web page.

    POST:2012-01-05 00:32 回复
  9. Sheri Stagnaro 说:

    Their such as you examine a head! You appear to recognize a great deal concerning this, for example people written your e book inside it or an item. I believe that you just may possibly undertake which includes pct to operate a vehicle the communication dwelling rather, but instead of that, this is exactly wonderful site. An impressive read through. I will undoubtedly come to be backside.

    POST:2012-01-05 14:40 回复
  10. Catherine McGibbon 说:

    Thanks for sharing excellent informations. Your site is so cool. I am impressed by the details that you have on this website. It reveals how nicely you perceive this subject. Bookmarked this web page, will come back for more articles. You, my friend, ROCK! I found just the information I already searched everywhere and simply couldn’t come across. What a great website.

    POST:2012-02-08 07:05 回复
  11. lastlonger 说:

    My buddy and I had been just talking about this particular issue, she is continually wanting to prove me completely wrong! I am going to present her this blog post not to mention rub it in a little!

    POST:2012-02-14 15:00 回复
  12. oem microsoft windows 7 说:

    Thanks-a-mundo for the blog article.Really looking forward to read more. Really Great.

    POST:2012-02-23 17:53 回复
VPSYOU合作推广
发表评论 点击取消评论.

*必填

*必填

  • 关于LinuxSEE

日志存档

  • 2012 年五月
  • 2012 年四月
  • 2012 年三月
  • 2012 年一月
  • 2011 年十二月
  • 2011 年十一月
  • 2011 年十月
  • 2011 年九月
  • 2011 年八月
  • 2011 年七月
  • 2011 年六月
  • 2011 年五月
  • 2011 年四月
>

热门文章

  • MYSQL多主一从多实例配置
  • APNIC获取准确的IP地址段
  • Linux下OPENVPN安装配置
  • 强制LINUX用户第一次登录改密码命令
  • 深入研究linux下命令之ls
  • 非常实用的iptables脚本
  • 新浪微博技术架构分析-转载
  • Linux下路由相关设置
  • 全国各地电信、网通、教育网及铁通的DNS服务器地址
  • 修改MySQL的内存表的三种方法

随机文章

  • MySQL配置文件my.cnf优化详解(ZT)
  • linux下查看服务器型号
  • 强制LINUX用户第一次登录改密码命令
  • scp和rsync传输带宽控制
  • MYSQL同步原理
  • Linux下kill某用户所有进程命令
  • Linux下sar使用举例之CPU
  • 通过网络安装Linux系统
  • Linux下top命令详解
  • Linux下syslog-ng安装笔记

最新评论

  • 今天有空就来看看你的站»
    Post: 2012-04-29 20:03:15
  • 这个脚本不错,来学习下»
    Post: 2012-04-11 03:37:35
  • 来看看你的博客,有空也去»
    Post: 2012-04-07 20:04:03
  • Great articl»
    Post: 2012-02-24 05:58:40
  • Noarmlly I'm»
    Post: 2012-02-24 05:56:32
  • Why does thi»
    Post: 2012-02-24 05:52:00
  • That's a qui»
    Post: 2012-02-24 05:50:44
  • Well macamdi»
    Post: 2012-02-24 05:50:36
  • Yours is a c»
    Post: 2012-02-24 05:31:50
  • These tpocis»
    Post: 2012-02-24 05:09:11

友情链接

  • 80sec
  • 9inow手机资源门户
  • DBA Notes
  • DeBugFs
  • linuxany.com
  • LinuxTone
  • linux论坛
  • 千千春光
  • 叶茂盛
  • 寒.枫
  • 张宴
  • 最实用的Linux博客
  • 服务器运维
  • 木易水瓶
  • 淘宝数据库技术团队
  • 淘宝核心系统团队博客
  • 简朝阳
  • 运维人生
Copyright © 2011-2012 LinuxSEE All rights reserved.