Mysql-proxy Construction

Source: Internet
Author: User
Tags lua

1. Application Environment

RDS (database) Migration between cloud vendors, mysql-proxy implementation of RDS instances can be accessed through the intranet, to achieve late database data export, import, master-slave operation

2, Mysql-proxy build environment

CentOS 6.5 +nginx

3, Build Mysql-proxy

1) Install Mysql-proxy

Yum-y Install Mysql-proxy

2) When the installation is complete, review the relevant information

Mysql-proxy-v

3) View Mysql-proxy Help options

Mysql-proxy-help-all

4) Mysql-proxy default port is often 4040,4041, which is configured in the configuration file

5) Turn on Mysql-proxy

1.touch/etc/mysql-proxy.cnf

2. Modify the configuration file

Vim/etc/mysql-proxy.cnf

[Mysql-proxy]

Admin-username=root #指定用户名

Admin-password=123fsck #用户密码

Admin-lua-script=/usr/lib64/mysql-proxy/lua/admin.lua #lua位置, see the version information above

Daemon=true # Mysql-proxy Run as Daemon

Keepalive=true #保持连接启动进程会有2个, process one to monitor process number second.

PROXY-BACKEND-ADDRESSES=10.6.X.XX #目标地址, DB Intranet address, default port 3306

Log-file=/var/log/mysql-proxy.log

Log-level=debug

proxy-address = 0.0.0.0:3306 Mysql-proxy Connection port

3. Modify Permissions

chmod 0660/etc/mysql-proxy.cnf

4. Start

Mysql-proxy--defaults-file=/etc/mysql-proxy.cnf

Connection mode:

Environment: Nginx

Nginx Extranet IP (mysql-proxy built-in)

A single intranet db

Mysql-h$nginx_ip-p$proxy-address-u$user-p$password

Mysql-h103.249.252.157-p3307-uroot-pkyrxailtjn


This article from "10946218" blog, declined reprint!

Mysql-proxy Build

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.