- 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
Get a list of MySQL databases and version?
To get a list of MySQL databases, following is the syntax -
To get the server version, you can use the below syntax -
Let us implement the above syntax to get a list of MySQL databases and version -
mysql> show databases;
This will produce the following output displaying all the databases -
+---------------------------+ | Database | +---------------------------+ | bothinnodbandmyisam | | business | | commandline | | customer-tracker | | customer_tracker_database | | customertracker | | database1 | | databasesample | | demo | | education | | hb_student_tracker | | hello | | information_schema | | instant_app | | javadatabase2 | | javasampledatabase | | login | | mybusiness | | mydatabase | | mysql | | onetomanyrelationship | | onlinebookstore | | performance_schema | | rdb | | sample | | sampledatabase | | schemasample | | slotgame | | sys | | test | | test3 | | tracker | | universitydatabase | | web | | web_tracker | | webtracker | +---------------------------+ 36 rows in set (0.00 sec)
Following is the query to get version -
mysql> select version();
This will produce the following output -
+-----------+ | version() | +-----------+ | 8.0.12 | +-----------+ 1 row in set (0.00 sec)
- Return list of databases in MySQL?
- How can I get a list of databases and collections on a MongoDB server?
- How to get the list of all databases using JDBC?
- List of non-empty tables in all your MySQL databases?
- How to get the list of all the MongoDB databases using java?
- Get a list of Constraints from MySQL Database?
- How to get a list of MySQL views?
- How to get a list of MySQL indexes?
- How to list databases vertically in MySQL command line?
- How can we display a list of currently existing MySQL databases on the server?
- What is the synonym statement of SHOW DATABASES with the help of which we can see the list of MySQL databases?
- Getting Information About MySQL Databases and Tables
- Get a list of Foreign Key constraints in MySQL
- How to get a list of MySQL user hosts?