title: LD_PRELOAD with MySQL
body: <p>I was wondering: with LD_PRELOAD, I can overwrite, and intercept functions written in C/C++.
  Is it possible, to intercept functions written in MySQL source code?</p>
  
  <p>For example, I would like a log file, to contain all MySQL connections (for auditing reasons).
  I would intercept the <strong>mysql_real_connect()</strong> C function is MySQL source, the following way:
      LD_PRELOAD=my_intercepting_connect.so mysql</p>
  
  <p>Will it (in theory) work? Has anyone done this, or similar?</p>