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