Windows (Wamp)에서 mysql 5.5.2를 사용하여 여러 데이터베이스를 사용하는 Java 애플리케이션을 작성 중입니다. 데이터베이스 이름과 생성 날짜를 나열하고 싶습니다. 데이터베이스에는 동일한 테이블의 유일한 데이터가 있습니다 (아카이브). 자바로 어떤 트릭?자바로 MySQL 데이터베이스 생성 날짜 받기
은 편집 :
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은"모두 나 "루트"에 의해 만들어지고 그들은 같은 테이블이 있습니다. 제 문제는 각각의 창작 날짜를 얻는 방법입니다.
나는이 솔루션을 발견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)
을하지만 마지막 생성 된 데이터베이스 정보 나를 보여줍니다. 해결책은 파일 생성 날짜를 보는 것일 수 있습니까?
사례에 대해 구현 한 SQL 쿼리가 있습니까? –
나는 내 질문을 편집 – Ayoub