Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MySQL Get Time of Old Record Insert?

Tags:

sql

mysql

I have a table in my database which contains all of the users for my application. Unfortunately, when I launched my application, I didn't think to include a column which tracked the time at which a particular user signed up, and now I wish I had (bad idea, yes indeed).

Is there, by any shred of luck, a way that MySQL tracks when a particular record is inserted (such as in record metadata???), and would allow me to grab it and insert in into a new dedicated column for this purpose?

I am running on a shared cPanel host, so I doubt I have access to the MySQL logs.

Thank you for your time.

like image 642
Oliver Spryn Avatar asked Sep 18 '12 01:09

Oliver Spryn


1 Answers

Only if you have binary logging enabled will you be able to trace exact times for the transaction.

http://dev.mysql.com/doc/refman/5.5/en/binary-log.html

Its not just for replication, but also a form of transactional recording in case of emergency.

like image 105
Michael Avatar answered Oct 22 '22 19:10

Michael