Showing entries 11 to 20 of 39
« 10 Newer Entries | 10 Older Entries »
Displaying posts with tag: MySQL Proxy (reset)
Using MySQL Proxy 0.8.2 on Windows

If you try to start proxy 0.8.2 in Windows, and you receive this error:

The application has failed to start because its side-by-side configuration is incorrect.

Then you need to install the Microsoft Visual C++ runtime libraries (per the 0.8.2 changelogs). Here is the snippet from the changelogs (it just doesn’t mention the error):

The Microsoft Visual C++ runtime libraries are now a requirement for running MySQL Proxy. Users that do not have these libraries must download and install the Microsoft Visual C++ 2008 Service Pack 1 Redistributable Package MFC Security Update. For the current Proxy version, use the following link to obtain the package:

http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=26368

(Bug #12836100)

[Read more]
MySQL Proxy 0.8.2 Has Been Released

We are pleased to announce the release of MySQL Proxy 0.8.2.

Downloads are available from dev.mysql.com:

http://dev.mysql.com/downloads/mysql-proxy/

0.8.2 is a maintenance release and focuses on:

  • Adding the protocol changes of MySQL 5.5 and later
  • Removing the "admin" plugin from the list of default plugins as it requires configuration since 0.8.1

Note to windows users:

The Microsoft Visual C++ runtime libraries are now a requirement for running MySQL Proxy.

Users that do not have these libraries must download and install the Microsoft Visual C++ 2008 Service Pack 1 Redistributable Package MFC Security Update.

For the current Proxy version, use the following link to obtain the package:

[Read more]
MySQL Proxy 0.8.2 Has Been Released

We are pleased to announce the release of MySQL Proxy 0.8.2.

Downloads are available from dev.mysql.com:

http://dev.mysql.com/downloads/mysql-proxy/

0.8.2 is a maintenance release and focuses on:

  • Adding the protocol changes of MySQL 5.5 and later
  • Removing the "admin" plugin from the list of default plugins as it requires configuration since 0.8.1

Note to windows users:

The Microsoft Visual C++ runtime libraries are now a requirement for running MySQL Proxy.

Users that do not have these libraries must download and install the Microsoft Visual C++ 2008 Service Pack 1 Redistributable Package MFC Security Update.

For the current Proxy version, use the following link to obtain the package:

[Read more]
mysqlnd plugins for PHP in practice

If you follow my blog or twitter stream you might know I've recently been at Barcelona to attend the PHP Barcelona conference. Conferences are great for exchanging ideas one of the ideas I discussed with Combell's Thijs Feryn: They are a hosting company providing managed MySQL instances to their customers, as such they run multiple MySQL servers and each server serves a few of their customers. Now they have to provide every customer with database credentials, including a host name to connect to. The issue there is that a fixed hostname takes flexibility out of the setup. Say you have db1.example.com and db2.example.com over time you figure out that there are two high load customers on db1 while db2 is mostly idle. …

[Read more]
Syntax for Creating a Windows Service for MySQL (when there are 2 paths which both contain spaces)

Numerous times now, I’ve seen people have troubles creating MySQL services on Windows manually (using ‘sc’), whether it be for mysqld itself, MySQL Proxy, or the MySQL Enterprise Monitor and/or Agent.

The proper syntax for ‘sc’ can get tricky when you have spaces in pathnames, which is very common in Windows, and the need for –defaults-file (which means two paths each potentially containing spaces).

So, if you have spaces in both your binpath and your path to –defaults-file, then the following syntax will work for you (all on a single line):

sc create MySQLEnterpriseMonitorAgent 
binpath= ""C:Program FilesMySQLEnterpriseAgentbinmysql-monitor-agent.exe" 
--defaults-file="C:Program FilesMySQLEnterpriseAgentetcmysql-monitor-agent.ini"" 
DisplayName= "MySQL Enterprise Monitor Agent" start= "auto"

Note that you could easily use the exact same syntax to install a Windows service for the MySQL server itself …

[Read more]
Getting LuaSocket to Work with MySQL Proxy

I’ve seen some interest in trying to get LuaSocket working with MySQL Proxy, and most of those interested have run into issues getting this set up, so I want to provide a brief walk-through on how to get this set-up and working properly.

Note I tested this on Windows, so use .so instead of .dll on *nix systems.

1. Download LuaSocket (contains lua/ and lib/ directories)

2. Copy contents of ‘lua/’ into the following directory:

C:Program FilesMySQLmysql-proxy-0.8.0libmysql-proxylua

3. Copy contents of ‘lib/’ into the following directory:

C:Program FilesMySQLmysql-proxy-0.8.0bin

4. In step #3, you should have copied a ‘socket/’ and ‘mime/’ directories into bin/. Rename the directory named “socket” to “lua-socket”. This will get you past one set of errors.

5. Next, in the C:Program …

[Read more]
Proxy Trace : Tracing the Variables and Functions Available within MySQL Proxy

Have you ever wanted a handy reference of all of the various variables available in MySQL Proxy?

I’ve written a Lua script that outputs many of the available variables, which is really useful for coding Lua scripts for MySQL Proxy. In addition to the variables, it also generates output during each main function it enters in the Proxy, so you can follow the execution trace, and then see the value of each variable when it is within a particular function.

I’ve tested this on MySQL Proxy 0.7.2 and the newly available Proxy 0.8.0.

Here is a sample of the output, where I just connect, and then issue a simple query (SELECT * FROM world.city LIMIT 1):

C:Program FilesMySQLmysql-proxy-0.8.0bin>mysql-proxy.exe
 --proxy-lua-script=show-vars.lua

/* Entering function connect_server() */
   When the proxy accepts a connection from a MySQL …
[Read more]
Writing output to a log file using MySQL Proxy

In my previous post, Capturing Erroneous Queries with MySQL Proxy, I showed how to capture erroneous queries, along with relevant information, that one could not effectively obtain from the MySQL general query log. However, in that post, I simply output the information to the terminal. Therefore, in this example, I want to show how to write this information to a proxy log file.

To change this to log to a log file does not require too many changes, and so this is a useful example on how to log any proxy-related information to a log file.

  1. I perform a check for an existing log file (at least using the variable of name “log_file”), and then assign log_file to the location of where I want the log file to reside (at the beginning of the lua script).
    if (log_file == nil) then
      log_file = "C:/Program Files/MySQL/mysql-proxy-0.7.2/proxy.log"
    end
[Read more]
SQL Analysis with MySQL Proxy – Part 2

As I outlined in Part 1 MySQL Proxy can be one tool for performing SQL analysis. The impact with any monitoring is the art of monitoring will affect the results, in this case the performance. I don’t recommend enabling this level of detailed monitoring in production, these techniques are designed for development, testing, and possibly stress testing.

This leads to the question, how do I monitor SQL in production? The simple answer to this question is, Sampling. Take a representative sample of your production system. The implementation of this depends on many factors including your programming technology stack, and your MySQL topology.

If for example you are using PHP, then defining MySQL proxy on a production system, and executing firewall rules to redirect incoming 3306 traffic to 4040 for a period of time, e.g. 2 …

[Read more]
SQL query analysis with MySQL Proxy

Long before there was the official Query Analyzer (QUAN), a component of MySQL Enterprise, SQL analysis was possible using MySQL Proxy.

The following is an introduction to logging and query analysis with MySQL Proxy.

Get MySQL Proxy

You need to first download MySQL Proxy. In this example I am using the Linux RHEL5 64bit OS and Version 0.7.2

$ wget http://dev.mysql.com/get/Downloads/MySQL-Proxy/mysql-proxy-0.7.2-linux-rhel5-x86-64bit.tar.gz/from/http://mirror.trouble-free.net/mysql_mirror/
$ tar xvfz mysql-proxy-0.7.2-linux-rhel5-x86-64bit.tar.gz
$ ln -s mysql-proxy-0.7.2-linux-rhel5-x86-64bit mysql-proxy
$ export PATH=`pwd`/mysql-proxy/sbin:$PATH
$ mysql-proxy --help-all

Pre-requisites

MySQL Proxy uses TCP/IP, so it is important you connect via the actual …

[Read more]
Showing entries 11 to 20 of 39
« 10 Newer Entries | 10 Older Entries »