Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Timetamp trouble

30 views
Skip to first unread message

Allassane Ousmane Berté

unread,
Dec 12, 2024, 4:42:44 AM12/12/24
to proxysql
Hello Everyone,
Hope you're all well.
We plan to deploy inside our infrastructure ProxySQL to secure users access to our MySQL backend databases but especially to trace their different actions on the databases. A now, we're testing it on local VM the version 2.7.1 before deploying it to our prod environnment.
during the tests, when I ran this following statement on proxysql admin console: <<select * from stats_mysql_query_digest;>>, and I got this result.
So my trouble is about data highlighted in red in the columns "first_seen and last_seen" which display the date and time of different requests ran on the DB in a format unreadable by a human. Is there any way to convert them in a readable format by a human?
Thank you very much.

ProxySQL.png

Yakir Gibraltar

unread,
Dec 12, 2024, 7:10:40 AM12/12/24
to Allassane Ousmane Berté, proxysql
SELECT FROM_UNIXTIME(..) FROM stats_mysql_query_digest;

--
You received this message because you are subscribed to the Google Groups "proxysql" group.
To unsubscribe from this group and stop receiving emails from it, send an email to proxysql+u...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/proxysql/4c77e13e-e369-49ec-98fd-874876ee954fn%40googlegroups.com.


--
Yakir Gibraltar | DBA
yak...@taboola.com
  |  +972 522036038   |  taboola.com

Allassane Ousmane Berté

unread,
Dec 13, 2024, 6:52:01 AM12/13/24
to proxysql
Hi 
I got this when I run the SQL statement you're propose
errror.png

Abhilash Rathod

unread,
Dec 19, 2024, 8:48:43 PM12/19/24
to Allassane Ousmane Berté, proxysql
Hello Allassane,

There are two different ways to convert this UNIX format to a human-readable format:
  1. Using Excel:
  • You can use your existing MySQL query to download the data with the existing UNIX format.
  • Then, you can make the changes in Excel using the following formula:
    • =(E34/86400)+25569 [Replace E34 with your cell number. Don’t forget to set the cell type to Date for the output cell]
   2. Using MySQL:
  • If you want the human-readable format directly from your existing query, you can use the following query:
    • SELECT *, FROM_UNIXTIME(first_seen) AS `first_seen_HR`, FROM_UNIXTIME(last_seen) AS `last_seen_HR` FROM stats_mysql_query_digest;
I hope this helps!!

--
You received this message because you are subscribed to the Google Groups "proxysql" group.
To unsubscribe from this group and stop receiving emails from it, send an email to proxysql+u...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/proxysql/4c77e13e-e369-49ec-98fd-874876ee954fn%40googlegroups.com.


--

Thanks & Regards

Abhilash Rathod

Reply all
Reply to author
Forward
0 new messages