The feature is used for the extranet client to connect to the intranet of MySQL, which installs the tool on the staging server. software version mysql-proxy-0.8.1-linux-rhel5-x86-64bit.tar.gz simple configuration process after decompression there are 5 directories bin include Lib Libexec share into the bin directory, View Mysql_proxy use Help [[email protected] bin]#./mysql-proxy--help-allusage:mysql-proxy [OPTION ...]-MySQL proxy assist Opti ONS:-?,--help Show Help Options--help-all Show all help options--help-admin Show options for the Admin-m Odule--help-proxy Show options for the Proxy-module admin-module--admin-add ress=<Host:port>listening Address:port of the Admin-server (default:: 4041)--admin-username=<string>username to allow to log in--admin-password=<string>password to allow to log in--admin-lua-script=<filename>script to execute by the admin plugin proxy-module-p,--proxy-address=<Host:port>listening Address:port of the Proxy-server (default:: 4040)-R,--proxy-read-only-backend-ad dresses=<Host:port>Address:port of the remote Slave-server (Default:not set)-B,--proxy-backend-addresses=<Host:port>Address:port of the remote Backend-servers (default:127.0.0.1:3306)--proxy-skip-profiling Disables profiling of Queries (default:enabled)--proxy-fix-bug-25371 Fix bug #25371 (mysqld > 5.1.12) for older Libmysql versions-s,--proxy-lua-script=<file>filename of the Lua script (Default:not set)--no-proxy Don ' t start the Proxy-module (default:enabled)--proxy-pool-no-change-user don ' t Use Change_user to reset the connection coming from the pool (default:enabled) application Options:-V,--version Show version--defaults-file=<file>configuration file--verbose-shutdown always L OG the exit code when shutting to--daemon Start in Daemon-mode--user= <User>Run mysql-proxy as user--basedir=<AbsolutePath>Base directory to prepend to relative paths in the config--pid-file=<file>PID file in case we is started as Daemon--plugin-dir=<Path>path to the plugins--plugins=<name>plugins to load--log-level= (error|warning|info|message|debug) Log a ll messages of level ... or higher--log-file=<file>log all messages in a file--log-use-syslog Log all messages to Syslog--log-backtrace-on-crash try-to-invoke debugger on crash --keepalive try to restart the proxy if it crashed--max-open-files Maximum number of open files (ulimit-n)--event-threads Number of event-handling threads (default:1)--lua-path=<...>set the Lua_path--lua-cpath=<...> set the Lua_cpath apply ./mysql-proxy--a Dmin-username= ' root '--admin-password= ' 12345 '--admin-lua-script=/opt/mysql-proxy-0.8.1-linux-rhel5-x86-64bit/ Lib/mysql-proxy/lua/admin.lua--proxy-backend-addresses=192.168.60.134:3306--daemon parameter description: Specify MySQL username and password, script to execute Mysql-proxy tool, MySQL server address and port, service mode Test # NETSTAT-TUNLP Active Internet connections (servers) Proto recv-q send-q Local address Foreign address state Pid/program name TCP 0 0 0.0.0.0:4040 0.0.0.0:* LISTEN 29237/mysql-pro XY TCP 0 0 0.0.0.0:4041 0.0.0.0:* LISTEN 29237/mysql-proxy 4040 Port is the default generation Port 4041 is the default management module Port Summary: You can now connect to the 4040 port of the transit server and access the MySQL server on the intranet. In addition to the connection can be forwarded, you can also do query monitoring, filtering, analysis, load balancing (load Balance), Failure Drift (Failover), and so on, more functional later.
Mysql-proxy Do Client connection forwarding "extranet access to intranet MySQL"