Which row in which table has been accessed at which time?

Which row in which table has been accessed at which time?

am 12.01.2011 16:26:15 von mysql

Hi listers
I have a mysql web application. in this application it would be fine to
be able to track the database entries i have visited, because often
later on i grat my head: which entry did i see this already in?
So i would need a way to find out which entries in which table i have
visited lately.
i first created a last_access table column and updated it before
selecting the table entry, but alas, this way i also updated the
last_update entry of the table which has "on update current_timestamp".
it can't be done this way.
i also looked for an "on select" event in mysql, but i was not sucessful.
also, the "show status" command was not helpful.
the complicated way would be to create a special table and make entries
into it whenever i access entries in different tables.
when googling around i found, it is even not easy to find out, which
tables have been accessed in general. if, now, i want to know even which
row in a particular table has been accessed at which time, the problem
gets even more difficult.
does anybody have a solution to this, which is easier than the
complicated way mentionned earlier?

thanks for any hints.

suomi

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql-2@m.gmane.org

Re: Which row in which table has been accessed at which time?

am 12.01.2011 16:35:55 von Martijn Tonies

Hi,

I could envision a way of doing this when accessing your tables
only via Stored Procedures instead of using them directly.

With regards,

Martijn Tonies
Upscene Productions
http://www.upscene.com

Download Database Workbench for Oracle, MS SQL Server, Sybase SQL
Anywhere, MySQL, InterBase, NexusDB and Firebird!


> Hi listers
> I have a mysql web application. in this application it would be fine to be
> able to track the database entries i have visited, because often later on
> i grat my head: which entry did i see this already in?
> So i would need a way to find out which entries in which table i have
> visited lately.
> i first created a last_access table column and updated it before selecting
> the table entry, but alas, this way i also updated the last_update entry
> of the table which has "on update current_timestamp". it can't be done
> this way.
> i also looked for an "on select" event in mysql, but i was not sucessful.
> also, the "show status" command was not helpful.
> the complicated way would be to create a special table and make entries
> into it whenever i access entries in different tables.
> when googling around i found, it is even not easy to find out, which
> tables have been accessed in general. if, now, i want to know even which
> row in a particular table has been accessed at which time, the problem
> gets even more difficult.
> does anybody have a solution to this, which is easier than the complicated
> way mentionned earlier?
>
> thanks for any hints.
>
> suomi
>
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe: http://lists.mysql.com/mysql?unsub=m.tonies@upscene.com
>


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql-2@m.gmane.org

Re: Which row in which table has been accessed at which time?

am 12.01.2011 18:28:22 von shawn.l.green

On 1/12/2011 10:26, mysql wrote:
> Hi listers
> I have a mysql web application. in this application it would be fine to
> be able to track the database entries i have visited, because often
> later on i grat my head: which entry did i see this already in?
> So i would need a way to find out which entries in which table i have
> visited lately.
> i first created a last_access table column and updated it before
> selecting the table entry, but alas, this way i also updated the
> last_update entry of the table which has "on update current_timestamp".
> it can't be done this way.
> i also looked for an "on select" event in mysql, but i was not sucessful.
> also, the "show status" command was not helpful.
> the complicated way would be to create a special table and make entries
> into it whenever i access entries in different tables.
> when googling around i found, it is even not easy to find out, which
> tables have been accessed in general. if, now, i want to know even which
> row in a particular table has been accessed at which time, the problem
> gets even more difficult.
> does anybody have a solution to this, which is easier than the
> complicated way mentionned earlier?
>
> thanks for any hints.
>
> suomi
>

It may be possible for some kind of client program to keep track of
which queries you executed but it is not practical at all for any
database system to record every access to every row if you expect any
sort of reasonable performance. Some very high-security situations can
be configured to do that but it *seriously* degrades performance to do
that much extra logging.

This is also not a behavior that MySQL can provide without some major
custom engineering. The closest sort of log we can provide to you for
that kind of tracing is the General Query Log
http://dev.mysql.com/doc/refman/5.5/en/query-log.html

Yours,
--
Shawn Green
MySQL Principal Technical Support Engineer
Oracle USA, Inc.
Office: Blountville, TN

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql-2@m.gmane.org

Function Question

am 12.01.2011 18:43:46 von Nicholas Moreno

My issue is actually in Excel. I'm hoping someone could help me...

I need to total the values in column B for "Emily". Is there a way other
than =3DSUM (B1+B2+B4+B7)? =20
--------------
Emily | 1
-------------
Emily | 5
-------------
Greg | 2
-------------
Bob | 7
-------------
Emily | 4
-------------
Jenn | 2
-------------
Greg | 1
-------------
Emily | 7
-------------
Bob | 3
-------------
Emily | 3
-------------


Nick Moreno|Communications Project Specialist|Home Federal Savings Bank

1016 Civic Center Drive NW|Rochester MN, 55901|Work 651-405-2010|Cell
612-987-0584 =20


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=3Dgcdmg-mysql-2@m.gmane.o rg

Re: Function Question

am 12.01.2011 19:09:59 von mos

Have you tried:

select UserName, Sum(ColB) from Table group by UserName;

or

select UserName, Sum(ColB) from Table group by UserName where
UserName="Emily";

Mike


At 11:43 AM 1/12/2011, Nicholas Moreno wrote:
>My issue is actually in Excel. I'm hoping someone could help me...
>
>I need to total the values in column B for "Emily". Is there a way other
>than =SUM (B1+B2+B4+B7)?
>--------------
>Emily | 1
>-------------
>Emily | 5
>-------------
>Greg | 2
>-------------
>Bob | 7
>-------------
>Emily | 4
>-------------
>Jenn | 2
>-------------
>Greg | 1
>-------------
>Emily | 7
>-------------
>Bob | 3
>-------------
>Emily | 3
>-------------
>
>
>Nick Moreno|Communications Project Specialist|Home Federal Savings Bank
>
>1016 Civic Center Drive NW|Rochester MN, 55901|Work 651-405-2010|Cell
>612-987-0584
>
>
>--
>MySQL General Mailing List
>For list archives: http://lists.mysql.com/mysql
>To unsubscribe: http://lists.mysql.com/mysql?unsub=mos99@fastmail.fm


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql-2@m.gmane.org