Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    MYSQL




View Query Logs


I have a db set up and it looks like nothing went to the db because of some errors. How do I open the query log to see if anything was registered.




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Mysql Logs Show Query With T_tablename
select col1 from table1;

shows

select t_table1.col1 from table1;

in the logs.

View Last Query Executed
I was wondering if it was possible to obtain the last query executed on a particular table? I have a request to log the queries executed on a particular table for audit purposes, but not sure if this is possible?

If I was hard coding the query before hand, I could obviously use this. However I am using php PDO connections following:

Quote:

$update = $db->prepare("UPDATE `table` SET {$fields} WHERE `id` = :id ");
$update->bindParam(':id', $data, PDO::PARAM_INT);
$update->execute();

The above is a simplified version, which is dynamically building the query. Essentially however I cannot obtain the whole query this way, so wondered if MySQL stored it ?

Query/View In MySql?
I am new to MySql (version 4.1). I used to use Views in Oracle that I can call them directly from my application. It seems like I can't do that with MySql. If I have a complicated query to run, I have to write the sql statement explicitly in the application each time I want to run that query. Is that true? Or am I missing something?

View Slow Query Log
I searched here, google and MySQL docs but did not find an answer.
I'm using MySQL-Front from a Windows platform to administer a remote database. The remote server doesn't have phpMyAdmin or anything like that.
MySQL-Front reports 133 Slow Queries and an average of 15 queries per second. But I dont' know how get more information than that.

How To View Arabic Data In MySQL Query Browser
I am making a website on linux and i am using a program called rekall to view the database and also the table was created using this program.

most of the data in the database are in Arabic and rekall views the data in an acceptable manner with some errors and without any configuration

but when I tried MySQL Query Browser on windows and several other programs including navicat, toad, heidiSQL all the arabic data was not viewable except the data in blobs which can be exported to extenal files

The website encoding is [ar-eg] and [utf-8]
I want to view the arabic data stored in the table using a windows program
and if the program is fast and simple it would be much better as I am not the one who is going to use it

What To Look For In Logs
We are seeting up some alerting mechanisms on a linux server running mysql.

We have a programme that will search for text strings in files and alert us if it detects one.

We could set it to look for ERROR or WARNING in the general or error log.

Does anyone have any suggestions an anything else or anything more specific to search for?

About MySQL Logs
while trying to output mysql logs file from a php file, I've got this message:

You are not using binary logging

So I would like to know what this mean and the reason I got this message!

Mysqld Logs
I have a DATABASE server running MySQLD 3.23.58.Users vist and sign up
their interest in my website.Now the problem is arising that when a
user signs up first , they get emails of confirmation from my
server.In addition to these emails , the customer also gets some
annoyed e-mails from someone residing/depending totllay on @yahoo.com
email-address maintaining the anonymity.

I did try by sending only e-mails to some my own email address,
whether someone is sniffering through my traffic, but I got no e-mail
except the ones I had sent myself.

After this I added some other email addresses in my DB server but I
sent no email to them at all.This time all email addresses got those
*annoying* e-mails also.

Errors And Logs
In the my.cnf file, under [mysqld] I have log-error=/path/to/error log
file directive. The last entries in this file are over an year ago. In
case of MYSQL errors, such as improper roll backs or improper commits,
shouldn't the errors be logged here. And if this is not the right
place, where would the errors be logged? The users claim some data in
the database changed automatically, I want to investigate any errors,
but I don't see a place where that information is.

Error Logs
I'm using mysql 3.23.54 over Red Hat Linux 9. I'm having problems with
the error logs.

I've run mysqld start --l, mysqld start --log, mysqld start
--log-error, and mysqld start --log=MyErrors.log and not once managed
to find a log file.

I'm running mysql and then issuing:- SELECT * FROM myFile WHERE 1;
which gives ERROR 1046: No Database Selected. That should surely be
logged in a file somewhere.

I'm using:- find / -amin -5 to select anything altered in the last
five minutes, after many fruitless hours trying to find the correctly
named files (from <http://dev.mysql.com/doc/mysql/en/query-log.html>).
I can't see anything containing that error.

Ultimately, I'm trying to work out whether a J2EE app has connected
with mySQL. I want to see whether the CORBA error I'm getting is
because mySQL rejected the request, or whether it's from CORBA itself.
If mySQL rejected it, there'd be an error message. I just can't see
any error message store at all. Can anyone see the error of my ways?

Security And Logs
There have been some problems with our server and things getting changed in mySQL, either via phpmyadmin or command line.

Is there a logging tool that can keep track of sql commands, what commands were run and give the IP information?

Very Large Bin Logs
We're getting several very large binary logs, reaching overall over 10GB which is a problem:

- When does mysql decide to purge the logs if at all
- Is there a way to control the number of bin logs created
- If the bin log size is set to a small number with max_binlog_size, will we get lots of small files ?

Importing Web Logs
I used to work with MSSQL. I has set up a sheduled task that imported the web log files into the database. Is this possible?

Binary Logs?
My environment:
2 servers, 1 shared storage, redhat cluster keeps mysql running on one node at a time. Not using replication or Mysql Cluster.

My need:
I'd like to move my binary logs to the local device of whatever server is the primary server.

My problem:
If I move my binary logs to the local disk (from the share, where they are now), what happens during a failover? If db01 fails to db02, there will be no binary logs waiting for it. Now, I THINK those binary logs will just start up again, but I can't be sure.

Lets say they do just start populating, brand new: what happens if i fail back? When I fail back the database will suddenly have old binary logs. What's a sys-admin to do?

MySQL Logs
I know then when I am using MySQL via the command interface, I can press the up arrow to scroll through previously typed statements. Is this information stored somewhere that can be accessed via log file or via a select statement? Is this available for all accounts?

MySQL Logs
when I am using MySQL via the command interface,I can
press the up arrow to scroll through previously typed statements.Is
this information stored somewhere that can be accessed via log file or
via a select statement?Is this available for all accounts?

MySQL Logs
I know then when I am using MySQL via the command interface, I can
press the up arrow to scroll through previously typed statements. Is
this information stored somewhere that can be accessed via log file or
via a select statement? Is this available for all accounts?

Mysqld Logs
I have a DATABASE server running MySQLD 3.23.58.Users vist and sign up
their interest in my website.Now the problem is arising that when a
user signs up first , they get emails of confirmation from my
server.In addition to these emails , the customer also gets some
annoyed e-mails from someone residing/depending totllay on @yahoo.com
email-address maintaining the anonymity.

I did try by sending only e-mails to some my own email address,
whether someone is sniffering through my traffic, but I got no e-mail
except the ones I had sent myself.

After this I added some other email addresses in my DB server but I
sent no email to them at all.This time all email addresses got those
*annoying* e-mails also.
I am really fed up with this issue, getting no clue how to come to
know about this.

Turn On The Logs
How to turn on the log exactly?? (For all type of logs). And would they all be stored in the ".../mysql/var" directory??

Mysql Logs
I have these logs both on the eclipse's console and the logfile and I want to remove it. I am using log4j to manage the logs:

Mon Jun 19 14:28:15 CEST 2006 TRACE: --> NonRegisteringDriver.java:259 com.mysql.jdbc.NonRegisteringDriver.connect("jdbc:mysql:"})
Mon Jun 19 14:28:15 CEST 2006 TRACE: --> NonRegisteringDriver.java:436 com.mysql.jdbc.NonRegisteringDriver.parseURL(""})
Mon Jun 19 14:28:15 CEST 2006 TRACE: --> StringUtils.java:1110 com.mysql.jdbc.StringUtils.startsWithIgnoreCase("")

Manager That Logs Activity
Im running a site that several users need access to the databse, and we are currently using phpmyadmin.

But we really need to log activity each user does in the database. As from time to time some dishonest users change things they are not suppose to change.

Any software like phpmyadmin that logs activity, and purhaps even limit access to the database,

Replication Bin Logs Issue
We are in the process of setting my mysql replication on mysql ver
4.1.18. However we have noticed an odd bug that occurs every so often.

Every hour we issue flush logs to mysql so that we can move the bin
logs to our backup server. In our mysql logs we notice the following;

060526 12:00:02 [ERROR] Failed to open log (file
'/srv/backup/mysql/mysql-bin.000068', errno 2)

This doesn't happen on each flush. This is resulting in us losing an
hours bin logs at a time which then causes replication to break (rows
are inserted during this time and as they are not logged to the bin
logs they never make it to the slaves).

errno 2 is "No such file or directory" however the structure is correct
and this is confirmed by the fact that the bin log rotation/flushing
does work correctly most of the time.

Does any one have any ideas why this may be taking place?

A Way To Implement Change Logs?
I've recently started using MYSQL and its got to a stage where i want to add a few features into it.

One of these things is that i want to have a log of all the changes that i make. Logging each cell that i change, and who it was changed by and when. Basically logging all the details of all the changes i make.

I know how to do this manually, like through making a new table and adding in the details by hand, which can be extremely time-consuming and boring to say the least.

I was wondering if anyone knew of any way that all the changes i make will be logged automatically after they are saved.

MySQL Administrator Logs
I have been using mysql database on two servers for about three years now. I recently downloaded the new MySQL Administrator and I love it. My only problem is I cannot see logs.

I am connected on the local machine and cannot find the option to turn on the logs or anything. I have looked through my.ini and everywhere.

Relay Logs Being Generated
I was looking through the mysql data directory and have noticed that relay logs are being generated on a regulay basis.These log names are in the format hostname-relay-bin.nnnnnn.
I was under the impression that relay logs were only generated if replicaition was set up/being used, and whilst I plan to set up replication in the near future,it is not being used at present.

Delete The Binary Logs
I would like to know if there is any way that I can clear the Binary logs related to one particular database only. I just want an alternative to the Query "Reset master" and "Purge [Master/Binary] logs". I need a query that would just delete the logs that are specific to a particular database.
The reason I need this is whenever I take a full backup/Binary backup using mysqldump/mysqlbinlog I would like to execute the reset master command because I dont need the statements in the Binary log because I already have a backup.. But now the problem is that I have taken the backup of only one database. And now if I use Reset master or Purge Master command , these command delete the entire logs. But what I want is the delete the logs of only one particular database

MySQL Binary Logs
I am taking backups of my databases with mysqlhotcopy.  MySQL keeps all binary logs.  I only need the most recent binary loigs after the backups to do forward recovery.  I would like to copy all logs to a NFS mount point (where they would be copied to TSM) and remove them from the active log directory.

Show Master Logs
When would SHOW MASTER LOGS be used?
I've had mysql hang 4 times this week and we've done all we can to fix it - but it seems that what we have done has only reduced the backlog of queries that occur when it hangs - now it hung again this morning and the only thing of note in the mysqladmin process list was SHOW MASTER LOGS - I googled it and there seemed to be a few cases of crash related bugs with this particular command - now I know I didnt issue the command so what would have done

PROBLEM WITH PURGE MASTER LOGS
I have a Server Linux with mysql 4.0.13 version with qmail server.

I run the command purge master logs but he return a message of error i/o.
The table "relay" on db vpopmail is corrupt and the command repair or restore not function.

Mysql Logs Files - How To Flush
I see some log files that are taking up 20 megs. How do I get rid of these, view them or work with them.

Using mysql 4.0.24

I have attempted the following:

E:mysql2in>mysqladmin.exe -u root -p -v flush-logs
Enter password: *******

E:mysql2in>mysqladmin.exe flush-logs -u root -p
Enter password: *******

However I still see the following files:

01/05/2006  11:49 PM        10,485,760 ibdata1
05/11/2005  03:44 PM            25,088 ib_arch_log_0000000000
01/05/2006  11:50 PM         5,242,880 ib_logfile0
05/11/2005  03:44 PM         5,242,880 ib_logfile1

Where To Find Error Logs For MySQL
Can any one tell me where to find the error logs for MySQL server 4.0.

Flush Logs, Binary Log Index File
I'm trying to write a script to weekly remove MySQL logs, the general,
error and binary log files.

Following the MySQL documentation, I've written a script that moves all
current log files, then executes mysqladmin flush-logs.

My question is this on the binary logs (bin.001, bin.002, etc.): once these
are removed and flush logs is executed, the binary log files start over
with bin.001.

HOWEVER, the binary index file does not appear affected by the flush-logs
command; ie, if I'm up to bin.003 in the binary.index file, remove the
files and execute the flush logs command, I'm back to a file names bin.001,
although the binary.index file still has entries for bin.001, bin.002,
bin.003, etc. How does the binary index file stay current when you remove
the logs??

Incremental Backups Using Update Logs With Multiple Databases
I've set up my server to keep update logs for incremental backups, as described in Kevin Yank's book (Build Your Own... 3rd Edition), but I've noticed that the update.* files have entries from all the databases on my server. Is there a way to automatically split up the log files so that I can have separate update.* files for each database?

InnoDB Binary Logs - Unique To Each Database Configuration
I would like to back-up our InnoDB databases using a combination of mysqldump and the binary logs. We have multiple databases within our server instance, and each database is unique to a customer so we don't want to mix their data. I know how to create / schedule unique dump files for each database, but was wondering how to configure unique binary logs. Right now all transactions are logged in the same set of files.

Binary Update Logs, Access FE, Distribuite Application
I'm entering in MySql world and I have some issue to solve.

I'm not finding a very well solution about the distribution of application upgrade.

I use a FE MSaccess-based, and I use a MSaccess-based launcher and update checker. To manage MySql DB from MSaccess, I use ADO, and it run well.

The question that I'm not solving is on my development-pc, because I'd want to import my binary update logs into my FE so I can apply it as update when I distribute the replication. To do this I need to import logs from my pc, convert and apply as
changes at (future) customer pcs.

So, how can I convert logs to txt and reconvert them to use it?

Is This Possible With A View?
I'm trying to cut down on the size of my database so I've changed it so that rather than implicitly setting every value in one table, I've split the data into two tables: one table (iData) contains data for the start of evey week:
iData
-----------------------------
2000-01-01 Volume: 20000000
2000-01-06 Volume: 30000000
2000-01-11 Volume: 40000000
Another table (jData) contains the delta (difference) from the previous iData entry:
jData
-----------------------------
2000-01-02 Volume: 1
2000-01-03 Volume: -2
2000-01-04 Volume: 1
2000-01-05 Volume: 3
2000-01-07 Volume: 2
2000-01-08 Volume: -5
2000-01-09 Volume: 6
2000-01-10 Volume: 1
2000-01-12 Volume: 2
2000-01-13 Volume: -4
2000-01-14 Volume: 4
2000-01-15 Volume: 3

Obviously this will save a lot of space as the delta is much smaller than storing the exact value (standard compression technique).

So what I would like to do is create a view to automatically display all of the data as if it were all stored in one table:

All Data:
---------
2000-01-01 Volume: 20000000
2000-01-02 Volume: 20000001
2000-01-03 Volume: 19999999
2000-01-04 Volume: 20000000
2000-01-05 Volume: 20000003
2000-01-06 Volume: 30000000
2000-01-07 Volume: 30000002
2000-01-08 Volume: 29999997
2000-01-09 Volume: 30000003
2000-01-10 Volume: 30000004
2000-01-11 Volume: 40000000
2000-01-12 Volume: 40000002
2000-01-13 Volume: 39999998
2000-01-14 Volume: 40000002
2000-01-15 Volume: 40000005

I know I can do this programatically, but is it possible to do this with a view? Any pointers would be much appreciated.



View SQL Files
I am about to by the content of a site, but it is in sql files. I need to view this content and extract to make a new site from it in html format.

How do I view SQL files and extract it content? Is there any program that does it?

Can I View .frm, .MYD And .MYI Files?
At my current host, the server crashed and all data seemed to be lost. Lucky for us they had had a backup of all data which they put back on the server.

But now I get errors with some tables in phpMyAdmin where they show up as "in use" and when I view them I get the following error:

MySQL
#1033 - Incorrect information in file: *.frm
or

MySQL
#1016 - Can't open file: '*.InnoDB'. (errno: 1)

Because of the issues, they send me the *.frm, *.MYD and *.MYI files.
But am I able to view these files to see the structure or data?
And can I verify if structure or data is corrupt?

View Implementation
Anybody has implemented View for MySQL?
I think it can be done outside of Database
if query transformation approach is used.

CREATE VIEW Model
SELECT * FROM Model_CA, Brand
WHERE Model_CA.brand_rid = Brand.rid

Select brand_name from Model
where model.name = 'Test'

This can be transformed into

SELECT brand_name FROM Model_CA, Brand
WHERE Model_CA.brand_rid = Brand.rid and
Model_CA.name = 'Test'

VIEW Problem
I create the next view:

CREATE VIEW VideoDB.FindCustomer AS
SELECT id, last_name&' '&name&' '&initial AS cname, picture, birthday, birthday_already, account_type, rents, exp_date, deposit, exp_deposit, auto1, kinship1, auto2, kinship2,
auto3, kinship3, auto4, kinship4, auto5, kinship5, auto6, kinship6
FROM VideoDB.customers;

When I execute the next statement the result is 0:
select cname from videodb.findcustomer;

How can I concat the whole name.
last_name&' '&name&' '&initial AS cname

Create A View
I have a master table and five detail tables. Now I want to have an overwiew on all detail tables that are related to the master table. The problem is that there are to many repeated records.

My wish is that to have each record of detail table in a single row with master table information in the view table. I tried to reach this with joins (left or right). No chance.. Code:

Mysqldump View
I try to dump the view definition and records using the following command.

mysqldump -uroot -psecret! --databases test --tables proxy_view > mytest.txt

What all I get is the view definition without records. What is the correct method of dumping a view?

Create View
I currently have a script that I have developed on a MS SQL server. As part of it I use a VIEW to do most of my lookups. I want to transfer it to a MYSql DB, but when I try and CREATE VIEW I get the following message....


mysql> create table t (qty INT, price INT);
mysal> insert into t values (3, 50);
mysql> create view v as select qty from t;
ERROR 1064: You have an error in your SQL syntax. Check the manual that corresp
onds to your MySQL server version for the right syntax to use near 'view testv a
s select qty from t' at line 1
mysql>

I am using MYSQL for Netware. I am using an example that I have found to demostrate it, but it just does not work.

Exponential View
how to store numbers in exponential view to MySQL. E.g. 4,56e-9 = 0,00000000456

I have 4,56e-9 as a variable in perl and want to store it to MySQL. Decimal as typ seems not to work. Does i realy have to convert it to 0,00000000456?

How To View All The Sp Created?
is there a way to view all the stored procedure created in mysql? a command to view all avaialble sp's?

Creating A View
I'm running the following create view:

create view letters_of_recommendation_x_organizations as select * from organizations o left join letters_of_reccomendation l on o.OrgID=l.orgid

, and getting an error "1064 (42000): You have an error in your SQL syntax; (blah blah blah) ... syntax to use near 'view junk as select * from organizations'"

I've checked the select statement - it runs ok.

I've tried a simpler select statement as well, "create view junk as select * from organizations" .

CREATING A VIEW
I am trying to creat a virtual table by using a dynamic sql. This sql needs to be reuseable on different applications. To make matters more simple to explain let's say my table is a 3 column table. The ID column is a process identifier.

ID     Integer
NAME   VARCHAR
VALUE  VARCHAR

The data will appear like this:

1      FIRSTNAME      JOE
1      LASTNAME       SMITH
2      FIRSTNAME      MARY
2      LASTNAME       JONES

I need to create a table that would take the data above and create the table like below:

ID           INTEGER
FIRSTNAME    VARCHAR
LASTNAME     VARCHAR

The data would look like this:

1      JOE            SMITH
2      MARY           JONES

Any ideas on this could work?

View Optimization
In my database I have separate four tables and from that four tables i have created one view. Each of the table contains round five lacs of records. So when view gives result it is approximately around fifteen lacs of records,

When I call that view like "select * from MyView where name='vimal'" it takes too long to give me result. And due to this one query my application server load increases by 80%. When I execute this view that time mysql Memory consumption is approximately 80% of total memory. What I can do to optimize the same? What are the other alternatives?

View Implementation
Anybody has implemented View for MySQL? I think it can be done outside of Database
if query transformation approach is used.

CREATE VIEW Model
SELECT * FROM Model_CA, Brand
WHERE Model_CA.brand_rid = Brand.rid

Select brand_name from Model
where model.name = 'Test'

This can be transformed into

SELECT brand_name FROM Model_CA, Brand
WHERE Model_CA.brand_rid = Brand.rid and
Model_CA.name = 'Test'


Copyright © 2005-08 www.BigResource.com, All rights reserved