데이터베이스 목록을 반환하는 구문은 다음과 같습니다. -
select schema_name as anyAliasName from information_schema.schemata;
다음은 MySQL에서 데이터베이스 목록을 반환하는 쿼리입니다 -
mysql> select schema_name as DatabaseName from information_schema.schemata;
이것은 다음과 같은 출력을 생성합니다 -
+---------------------------+ | DatabaseName | +---------------------------+ | mysql | | information_schema | | performance_schema | | sys | | business | | sample | | hello | | test | | mybusiness | | databasesample | | schemasample | | universitydatabase | | education | | mydatabase | | database1 | | sampledatabase | | test3 | | javadatabase2 | | javasampledatabase | | rdb | | onetomanyrelationship | | webtracker | | web | | commandline | | hb_student_tracker | | bothinnodbandmyisam | | customertracker | | tracker | | demo | | customer_tracker_database | | login | | onlinebookstore | | customer-tracker | | web_tracker | | instant_app | | 1233 | +---------------------------+ 36 rows in set (0.00 sec)