- Trending Categories
- Data Structure
- Operating System
- C Programming
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Return list of databases in MySQL?
To return list of databases, the syntax is as follows −
select schema_name as anyAliasName from information_schema.schemata;
Here is the query to return list of databases in MySQL −
mysql> select schema_name as DatabaseName from information_schema.schemata;
This will produce the following output −
+---------------------------+ | 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)
- Get a list of MySQL databases and version?
- List of non-empty tables in all your MySQL databases?
- How to list databases vertically in MySQL command line?
- What is the synonym statement of SHOW DATABASES with the help of which we can see the list of MySQL databases?
- How can we display a list of currently existing MySQL databases on the server?
- Which MySQL query can be used with the help of which we can see the list of MySQL databases?
- Types of databases
- How to get the list of all databases using JDBC?
- MySQL permissions to view all databases?
- Copying MySQL Databases to another Machine
- How to list all databases in the Mongo shell?
- Finding total number of rows of tables across multiple databases in MySQL?
- Getting Information About MySQL Databases and Tables
- How to get the list of all the MongoDB databases using java?
- What MySQL databases do I have permissions on?