Solved

Tracking mySQL Connection and Query Statements

Posted on 2004-08-03
3
895 Views
Last Modified: 2008-02-01
This might not have an answer but if there is any possible options, please chime in...

The server environment is mySQL 4.x under red hat 9
The client is vb.net application with Seven Objects mySQL OLEDB integration ( http://www.sevenobjects.com ) A second client application is legacy app which requires ODBC connectivity.

The vb.net client has audit and tracing built in. The legacy app hooks in using mySQL ODBS v3.51 on the local machine. We have a problem where there is believed to be an enterprising individual making ODBC connections via ODBC and not only viewing data but in some cases dropping tables or deleting ranges of records. The most obvious solution would be to rewrite the legacy app... Being done, but it will be months to finish. Customer needs a more immediate fix.

The question: mySQL does not have and can not currently be recompiled with the --DEBUG functionality which would allow us to turn on a trace to determine where this connection is coming from and record the query sent to the server. I need to do these in some other fashion. Does anyone have any insight on what I could do to track down this possible rogue user. This question is time critical...

Thank you very, very much in advance...
Gregory A. Miller
AGBSM Networks
AGBSM, LLC

If there are multiple suggestions from multiple persons which yield good advice and is useable in the scenario listed, I will be happy to split points and/or add more...
0
Comment
Question by:Gregory Miller
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 17

Accepted Solution

by:
akshah123 earned 500 total points
ID: 11715908
I am not sure if this leads you to some solution or not, but following page shows you options as to view the logs that mysql keeps.

http://dev.mysql.com/doc/mysql/en/Log_Files.html

Plus, using commands such as
show processlist;
from time to time you can see what users are online and what queries are running.
0
 
LVL 11

Author Comment

by:Gregory Miller
ID: 11716433
Indirectly, your answer helped... I dug a little deeper and found this, which I has not noticed before. It solved the problem and is providing me a log file of all connections and queries... Thank you so much...

Note that if you use --log=/var/log/mysqld.log and the mysql user doesn't have privileges in that directory, you can work around this by:
(1) becoming root:
su
(2) changing to the target directory:
cd /var/log
(3) creating the log initially
touch mysqld.log
(4) allowing anyone to write to it:
chmod 777 mysqld.log
(5) restarting mysql

This solved a problem I was having where mysqld would not create the initial log file even with the proper command-line args, but wouldn't complain about it, either. It would just silently go on.


0
 
LVL 11

Author Comment

by:Gregory Miller
ID: 11716452
I actually set ownership to the process owner and did not chmod the file 777 and this also worked and is more secure
0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL several years ago, it seemed like now was a good time to update it for object-oriented PHP.  This article does that, replacing as much as possible the pr…
Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

635 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question