Root access or administrative rights to the uBuntu server.
uBuntu Server 12.04 installed.
OpenSSH Server installed in the server.
Ensure gcc with all its development libraries are installed.
Ensure gnu make is installed in the server.
Works on x64 ubuntu
Installation steps :
Download the mysql proxy source sudo wget http://dev.mysql.com/get/Downloads/MySQL-Proxy/mysql-proxy-0.8.4.tar.gz
Unpack/Extract the source in your favorite temporary working directory
Extract mysql_proxy source sudo tar -xzvf mysql-proxy-0.8.4.tar.gz
Install the libmysql. sudo apt-get install libmysql++-dev
Preparing to create configuration using source sudo ./configure
The first run from the configure will result in configuration error due to dependent libraries/apps were not installed. configure: error: The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config.
To proceed install the pkg-config. sudo apt-get install pkg-config
Rerun configure. The error will indicate LUA were not installed. checking pkg-config is at least version 0.9.0... yes checking for LUA... no ... checked for Lua via pkg-config: No package 'lua' found. retrying with lua5.1 checking for LUA... no configure: error: checked for Lua via pkg-config: No package 'lua5.1' found. Make sure lua and its devel-package, which includes the lua5.1.pc (debian and friends) or lua.pc (all others) file, is installed
To fix the dependency error, install LUA and the LUA mysql library. sudo apt-get install lua5.1
sudo apt-get install liblua5.1 sudo apt-get install liblua5.1-sql-mysql2
Rerun the configure, the next error is missing glib. checking pkg-config is at least version 0.9.0... yes checking for LUA... no ... checked for Lua via pkg-config: No package 'lua' found. retrying with lua5.1 checking for LUA... yes checking for GLIB... configure: error: Package requirements (glib-2.0 >= 2.16.0) were not met:
Install the missing glib and glib libraries. sudo apt-get install glib2.0 sudo apt-get install libglib2.0-0
Error still occurs, missing libevent error during configurationconfigure: error: libevent is required
After installing pk-config, lua, glib and libevent, all dependencies should be resolved, continue to rerun configure.
Continue to run the compilation and installation after the is configure completed. sudo make
sudo make install
Test the mysql-proxy. Running mysql-proxy for the first timesudo mysql-proxy
If there is a following error while running mysql-proxy, and the missing library is found proceed with next step.mysql-proxy: error while loading shared libraries: libmysql-chassis.so.0: cannot open shared object file: No such file or directory
To fix the error, run ldconfig .sudo ldconfig
Rerun mysql-proxy. If you are getting the output below means you have successfully installed mysql-proxy.Usage:
mysql-proxy [OPTION...] - MySQL Proxy
-h, --help Show help options
--help-all Show all help options
--help-proxy Show options for the proxy-module
-V, --version Show version
--defaults-file= configuration file
--verbose-shutdown Always log the exit code when shutting down
--daemon Start in daemon-mode
--user= Run mysql-proxy as user
--basedir= Base directory to prepend to relative paths in the config
--pid-file= PID file in case we are started as daemon
path to the plugins
--plugins= plugins to load
--log-level=(error|warning|info|message|debug) log all messages of level ... or higher
--log-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
Pingback: how to install mysql proxy quick and easy | Out of the box.
Very use full this doc.