Thanks Chanaka, but as far as I can tell that only shows table creation time (which phpMyAdmin already does anyway), what we're trying to solve is the creation time of the database. Am I mistaken?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Isaac,
No you got it correctly. I misunderstood that.
Btw, neither me could find a way to get the DB create time using a query. But we can get the create time of the first table. (SELECT MIN(create_time)
FROM INFORMATION_SCHEMA.TABLES WHERE table_schema = 'my_database'). But still it's not pretty accurate for all scenarios.
What I was thinking of the MySQL data directory. When creating a db 'mydb', there will be a directory 'mydb' and inside that, db.opt file. I think what we are looking for is the last modified time of this 'db.opt' file. Still accessing these file from PMA is doubtfull. (I check with 5.5.34-0ubuntu0.13.04.1 - (Ubuntu))
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I've done some searching and can't see a way to find the creation date of a database. Are you aware of any way?
Isaac,
For MySQl, try this,
SELECT TABLE_SCHEMA, CREATE_TIME FROM INFORMATION_SCHEMA.TABLES;
Thanks Chanaka, but as far as I can tell that only shows table creation time (which phpMyAdmin already does anyway), what we're trying to solve is the creation time of the database. Am I mistaken?
Isaac,
No you got it correctly. I misunderstood that.
Btw, neither me could find a way to get the DB create time using a query. But we can get the create time of the first table. (SELECT MIN(create_time)
FROM INFORMATION_SCHEMA.TABLES WHERE table_schema = 'my_database'). But still it's not pretty accurate for all scenarios.
What I was thinking of the MySQL data directory. When creating a db 'mydb', there will be a directory 'mydb' and inside that, db.opt file. I think what we are looking for is the last modified time of this 'db.opt' file. Still accessing these file from PMA is doubtfull. (I check with 5.5.34-0ubuntu0.13.04.1 - (Ubuntu))
I don't think this is something we can reliably determine at this time. If MySQL adds this feature, we'll certainly implement it at that time.
Thanks for your suggestion.