x
Loading
 Loading
Hello, Guest | Login | Register
Linux on Blades Resource Center

Understanding MySQL Proxy

Linux Magazine’s Jeremy Garcia shows you how to take command of MySQL using MySQL Proxy, a lightweight application that sits between MySQL server and client applications. Using MySQL Proxy, you can set up load balancing, dynamic fail over, query analysis, query filtering, query modification, and more.

The new MySQL Proxy is a lightweight program that sits between your client and your MySQL database and monitors, analyzes, and manipulates the communication. Your client connects to the proxy via your usual credentials. From there, an embedded Lua interpreter allows you to perform arbitrary actions on both the incoming query and the result set. Such interception and manipulations provides for a variety of uses, including load balancing, dynamic fail over, query analysis, query filtering, query modification, and more. The power of MySQL Proxy is the flexibility offered by the Lua engine.

MySQL Proxy is licensed under the GNU Public License and is available for download from http://forge.mysql.com/wiki/MySQL_Proxy. Keep in mind that the product is still young, so you may encounter a few rough edges. Additionally, versions MySQL 5.x and up are the only releases officially supported.

While official binaries are available for some platforms, you may prefer to use the Subversion tree, since it contains the bleeding-edge code. To check MySQL Proxy out, compile, and install, perform the following:

  $ svn co http://svn.mysql.com/ svnpublic/mysql-proxy/ mysql-proxy $ cd mysql-proxy/trunk $ ./autogen.sh $ ./configure && make distcheck # make install  

Once installed, run /usr/local/sbin/mysql-proxy --help-all to get a list of all command-line options. By default, the software’s proxy module listens on port 4040 and its administration module listens on port 4041, and all connections are passed to localhost, or 127.0.0.1. The Subversion tree contains some sample Lua scripts to get you started.

The following examples…

Please log in to view this content.

Not Yet a Member?

Register with LinuxMagazine.com and get free access to the entire archive, including:

  • Hands-on Content
  • White Papers
  • Community Features
  • And more.
Already a Member?
Log in!
Username

Password

Remember me

Forgotten your password?
Forgotten your username?

Have you deployed Linux on Blade Servers?


Loading ... Loading ...