-
Notifications
You must be signed in to change notification settings - Fork 1
MySQL Proxy
Sebastian edited this page Aug 29, 2016
·
9 revisions
MySQL Proxy provides possibilities to log and rewrite SQL Querries. As the name suggests, it is used as a proxy between the application and the database. A good Tutorial and further techniques can be found here.
##MySQL Proxy and Enterprise Architect Follow these steps to use MySQL Proxy with Enterprise Architect (Tested with Version 12):
- Download the latest release of MySQL Proxy and extract the archive.
- Go into the bin Folder and create a file named code.lua - To get started, insert the following lines:
function read_query(packet) if string.byte(packet) == proxy.COM_QUERY then print(string.sub(packet, 2)) end end ``` This is a basic logging script that writes all querries to the console output.
-
Launch MySQL-Proxy with the the following command:
mysql-proxy.exe --proxy-backend-addresses= --proxy-lua-script= ``` It is important to use the full path to the lua file. A relative path might not work!
- Create a new ODBC Datasource. If not specified, the TCP/IP is
localhost
, the port4040
. Use your login data and the destination database. Also enter the details specified here (Allow big results, Matched rows instead of affected rows).