'Find User Creation Date in Mysql?

Is there any way to find the time when a user was created? It means to trace the user creation date in mysql.

Please help me out.

Thanks,

Nitesh Kumar



Solution 1:[1]

You can add timestamp along with user information when user creation form is submitted otherwise there is no way to track that.

Solution 2:[2]

You have to add new field in your database users table say it "created" with type DATETIME

Sample Query is here:

ALTER TABLE `users` ADD `created` DATETIME NOT NULL COMMENT 'user created date' AFTER `name` 

Here AFTER name is the last field of table so that it will add new field created at last of users table.

Solution 3:[3]

You can add a new TIMESTAMP field to your table, but remember to set CURRENT_TIMESTAMP as default value, so when the record is created, this field gets the timestamp from when the record is created.

I'd say it's impossible to tell afterwards when a record has been created, maybe with some kind of using binary logs, but i don't know much about that.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Rakesh Shetty
Solution 2 gaurang171
Solution 3 Stefan