Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Tracking mySQL Connection and Query Statements

Posted on 2004-08-03
3
Medium Priority
?
897 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 2000 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

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

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

In this series, we will discuss common questions received as a database Solutions Engineer at Percona. In this role, we speak with a wide array of MySQL and MongoDB users responsible for both extremely large and complex environments to smaller singl…
This post looks at MongoDB and MySQL, and covers high-level MongoDB strengths, weaknesses, features, and uses from the perspective of an SQL user.
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

705 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