See My Queries
- Started
- Last post
- 11 Responses
- phirschybar
Is there a way for me to see the recently executed MySQL queries that have taken place for a certain database?
- rasko40
oops sorry, I thought the jox photo thread.
- phirschybar0
LOL... damn I thought you had THE answer. Oh well....
- DutchBoy0
nice queries.. you always wear them like that? i think these are hot, man!
- phirschybar0
oh no.. these responses are like anchors sinking this thread to the bottom of the list...
- thirtytwo0
Create your query as a VAR,
$strSQL = "select * from Tablename"
then
print "$strSQL";
before you execute it...
- phirschybar0
thirtytwo... I don't actually have access to the script that is executing the query. It is running on a remote server and tapping into my DB contents. I just want to see the structure of the query. Is there a way to set up a log to view all recent queries?
- thirtytwo0
Opps, did not read it correctly...
You can save all query vars to a separate table with a datetime stamp to be viewed later...
We do this all the time, so we can see a trend in searches
- phirschybar0
hmmm... "save all query vars"? Not sure I understand how to do this. Are query vars created temporarily when a query gets executed?
- thirtytwo0
You should be able to look at the logs already in MySQL...
var/lib/mysql
hope this helps, I have not touch MySQL in about 2 years so I might be off with my path...
- thirtytwo0
We have complex queries, that have "if" statements in them. So we always make the statements variables. You can then save the var into a nvarchar with a datetime stamp...
hope that helps...
- phirschybar0
I checked that path on the server but no luck finding a log... Any UNIX users out there who might know the answer to this.
I like your variable idea but again, I don't have access to the scripts which are creating the queries... Am I missing something?