在 Windows (Wamp) 上使用 mysql 5.5.2 我正在编写一个使用多个数据库的 Java 应用程序。我想列出数据库名称及其创建日期。数据库具有同一张表的唯一数据不同(档案)。Java有什么技巧吗?
编辑:
mysql> show databases;
+-------------------------+
| Database |
+-------------------------+
| information_schema |
| formaction_archive_test |
| mysql |
| performance_schema |
| sw_formaction |
| test |
+-------------------------+
6 rows in set (0.00 sec)
“formaction_archive_test”和“sw_formaction”都是由我“root”创建的,它们有相同的表。我的问题是如何获得他们各自的创建日期。
我找到了这个解决方案:
mysql> use information_schema;
Database changed
mysql> SELECT table_name, create_time
-> FROM tables
-> WHERE table_schema NOT IN('mysql', 'information_schema') ;
+----------------------------------------------+---------------------+
| table_name | create_time |
+----------------------------------------------+---------------------+
| cond_instances | NULL |
| events_waits_current | NULL |
| events_waits_history | NULL |
| events_waits_history_long | NULL |
| events_waits_summary_by_instance | NULL |
| events_waits_summary_by_thread_by_event_name | NULL |
| events_waits_summary_global_by_event_name | NULL |
| file_instances | NULL |
| file_summary_by_event_name | NULL |
| file_summary_by_instance | NULL |
| mutex_instances | NULL |
| performance_timers | NULL |
| rwlock_instances | NULL |
| setup_consumers | NULL |
| setup_instruments | NULL |
| setup_timers | NULL |
| threads | NULL |
| annee | 2012-06-06 16:19:04 |
| categorie | 2012-06-06 16:19:04 |
| certification | 2012-06-06 16:19:04 |
| client | 2012-06-06 16:19:04 |
| clientold | 2012-06-06 16:19:04 |
| connaisance_ecole | 2012-06-06 16:19:04 |
| duree | 2012-06-06 16:19:04 |
| eleve | 2012-06-06 16:19:04 |
| famille | 2012-06-06 16:19:04 |
| formateur | 2012-06-06 16:19:04 |
| formation | 2012-06-06 16:19:04 |
| inscription | 2012-06-06 16:19:04 |
| lieux | 2012-06-06 16:19:05 |
| lst_formation | 2012-06-06 16:19:05 |
| moyen_paiement | 2012-06-06 16:19:05 |
| paiement | 2012-06-06 16:19:05 |
| session | 2012-06-06 16:19:05 |
| souhait | 2012-06-06 16:19:05 |
| souhaits | 2012-06-06 16:19:05 |
| type_certification | 2012-06-06 16:19:05 |
+----------------------------------------------+---------------------+
37 rows in set (0.01 sec)
但它只向我显示了最后创建的数据库信息。可能的解决方案是查看文件创建日期?