{"id":4892,"date":"2020-03-13T13:20:46","date_gmt":"2020-03-13T17:20:46","guid":{"rendered":"https:\/\/www.globo.tech\/learning-center\/?p=4892"},"modified":"2020-03-13T13:20:47","modified_gmt":"2020-03-13T17:20:47","slug":"how-to-show-list-of-mysql-databases","status":"publish","type":"post","link":"https:\/\/www.globo.tech\/learning-center\/how-to-show-list-of-mysql-databases\/","title":{"rendered":"How to show list of MySQL databases"},"content":{"rendered":"\n<figure class=\"wp-block-image size-large is-style-default\"><img loading=\"lazy\" decoding=\"async\" width=\"1200\" height=\"628\" src=\"https:\/\/www.globo.tech\/learning-center\/wp-content\/uploads\/2020\/03\/HowToShowListMySQLDatabases.jpg\" alt=\"How to show lists of MySQL Databases.\" class=\"wp-image-4893\"\/><\/figure>\n\n\n\n<p>If you are a database administrator, you should familiar with MySQL environment and know how to manage MySQL from command-line. One of the most common task is to show a list of MySQL databases available in the server. There are several to show list of MySQL databases in <a href=\"https:\/\/www.globo.tech\/dedicated-server-hosting\">Linux operating systems<\/a>.<\/p>\n\n\n\n<p>In this tutorial, we will explain how to show list of <a href=\"https:\/\/dev.mysql.com\/downloads\/mysql\/\">MySQL<\/a> databases in Linux.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">List all MySQL Databases From Command Line<\/h2>\n\n\n\n<p><strong>1-<\/strong> You can list all databases for a specific user which have some privilege granted to using the following syntax:<\/p>\n\n\n\n<p><code> mysql -u username -p -e 'show databases;'<\/code><\/p>\n\n\n\n<p>For example, list all databases for MySQL root user with the following command:<\/p>\n\n\n\n<p><code> mysql -u root -p -e 'show databases;'<\/code><\/p>\n\n\n\n<p>Provide your root MySQL password and hit Enter to list all databases as shown below:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"> Enter password:  \n +--------------------+\n | Database           |\n +--------------------+\n | booker             |\n | bookman            |\n | books              |\n | guest              |\n | information_schema |\n | movies             |\n | mysql              |\n | performance_schema |\n | sys                |\n +--------------------+<\/pre>\n\n\n\n<br class=\"custom-break\">\n\n\n\n<figure class=\"wp-block-image size-large is-resized is-style-default\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.globo.tech\/learning-center\/wp-content\/uploads\/2020\/03\/Show-databases-1.png\" alt=\"Show databases in command line.\" class=\"wp-image-4895\" width=\"838\" height=\"219\"\/><\/figure>\n\n\n\n<p><strong>2-<\/strong> Next, list all databases for user hitesh with the following command:<\/p>\n\n\n\n<p><code> mysql -u hitesh -p -e 'show databases;'<\/code><\/p>\n\n\n\n<p>Provide your hitesh user MySQL password and hit Enter to list all databases as shown below:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"> Enter password:  \n +--------------------+\n | Database           |\n +--------------------+\n | guest              |\n | information_schema |\n | movies             |\n +--------------------+ <\/pre>\n\n\n\n<br class=\"custom-break\">\n\n\n\n<figure class=\"wp-block-image size-large is-resized is-style-default\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.globo.tech\/learning-center\/wp-content\/uploads\/2020\/03\/Show-databases-2.png\" alt=\"Show databases for one user in command line.\" class=\"wp-image-4896\" width=\"838\" height=\"140\"\/><\/figure>\n\n\n\n<p><strong>3-<\/strong> You can also list all MySQL databases using mysqlshow command as shown below:<\/p>\n\n\n\n<p><code> mysqlshow -u root -p<\/code><\/p>\n\n\n\n<p>You should get the following output:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"> Enter password:  \n +--------------------+\n |     Databases      |\n +--------------------+\n | booker             |\n | bookman            |\n | books              |\n | guest              |\n | information_schema |\n | movies             |\n | mysql              |\n | performance_schema |\n | sys                |\n +--------------------+ <\/pre>\n\n\n\n<br class=\"custom-break\">\n\n\n\n<figure class=\"wp-block-image size-large is-resized is-style-default\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.globo.tech\/learning-center\/wp-content\/uploads\/2020\/03\/Show-databases-3.png\" alt=\"Show databases for all user in command line with mysqlshow command.\" class=\"wp-image-4897\" width=\"788\" height=\"306\"\/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">List all MySQL Databases From MySQL Shell<\/h2>\n\n\n\n<p>You can also list all MySQL databases after log in to MySQL shell.<\/p>\n\n\n\n<p>First, log in to MySQL shell with root user as shown below:<\/p>\n\n\n\n<p><code> mysql -u root -p<\/code><\/p>\n\n\n\n<p>Provide your root MySQL password and hit Enter to log in the MySQL shell:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"> Welcome to the MySQL monitor.  Commands end with ; or \\g.\n Your MySQL connection id is 54\n Server version: 8.0.19 MySQL Community Server - GPL\n \n \n Copyright (c) 2000, 2020, Oracle and\/or its affiliates. All rights reserved.\n \n \n Oracle is a registered trademark of Oracle Corporation and\/or its\n affiliates. Other names may be trademarks of their respective\n owners.\n \n \n Type 'help;' or '\\h' for help. Type '\\c' to clear the current input statement.\n \n \n mysql><\/pre>\n\n\n\n<br class=\"custom-break\">\n\n\n\n<figure class=\"wp-block-image size-large is-resized is-style-default\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.globo.tech\/learning-center\/wp-content\/uploads\/2020\/03\/Mysql-command.png\" alt=\"Log into mysql in command line using user root.\" class=\"wp-image-4898\" width=\"788\" height=\"217\"\/><\/figure>\n\n\n\n<p>Next, run the following command to list all databases of MySQL root user:<\/p>\n\n\n\n<p><code> mysql> show databases;<\/code><\/p>\n\n\n\n<p>You should see all the databases in the following output:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"> +--------------------+\n | Database           |\n +--------------------+\n | booker             |\n | bookman            |\n | books              |\n | guest              |\n | information_schema |\n | movies             |\n | mysql              |\n | performance_schema |\n | sys                |\n +--------------------+\n 9 rows in set (0.00 sec)<\/pre>\n\n\n\n<br class=\"custom-break\">\n\n\n\n<figure class=\"wp-block-image size-large is-resized is-style-default\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.globo.tech\/learning-center\/wp-content\/uploads\/2020\/03\/Mysql-command-2.png\" alt=\"Show databases from mysql cli.\" class=\"wp-image-4899\" width=\"567\" height=\"247\"\/><\/figure>\n\n\n\n<p>If you have a long list of databases and want to list a specific database use the following syntax:<\/p>\n\n\n\n<p><code> show databases like 'string%';<\/code><\/p>\n\n\n\n<p>For example, list all databases that start with the letters book using the following command:<\/p>\n\n\n\n<p><code> show databases like 'book%';<\/code><\/p>\n\n\n\n<p>You should see all the databases that start with the letters book in the following output:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"> +------------------+\n | Database (book%) |\n +------------------+\n | booker           |\n | bookman          |\n | books            |\n +------------------+\n 3 rows in set (0.00 sec) <\/pre>\n\n\n\n<br class=\"custom-break\">\n\n\n\n<figure class=\"wp-block-image size-large is-resized is-style-default\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.globo.tech\/learning-center\/wp-content\/uploads\/2020\/03\/Mysql-command-3.png\" alt=\"Show all databases that contains the string &quot;book&quot; from mysql cli.\" class=\"wp-image-4900\" width=\"567\" height=\"152\"\/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">List all MySQL Databases Using PHPMyAdmin<\/h2>\n\n\n\n<p>If your server is hosted on the remote hosting company and they do not allow command-line access then you can list all databases using the PHPMyAdmin web interface.<\/p>\n\n\n\n<p><strong>1-<\/strong> First, open your web browser and type the PHPMyAdmin URL.  After login, you should see the following screen:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized is-style-default\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.globo.tech\/learning-center\/wp-content\/uploads\/2020\/03\/PHPMyAdmin-1.png\" alt=\"First, log into PHPMyAdmin.\" class=\"wp-image-4901\" width=\"974\" height=\"503\"\/><\/figure>\n\n\n\n<p><strong>2-<\/strong> Now, click on the <strong>Databases<\/strong>, you should see all the databases in the following screen:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized is-style-default\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.globo.tech\/learning-center\/wp-content\/uploads\/2020\/03\/PHPMyAdmin-2.png\" alt=\"Then, click on Databases into PHPMyAdmin to show all databases of the user you're logged in.\" class=\"wp-image-4902\" width=\"974\" height=\"505\"\/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p>In the above guide, you learned how to list all databases using command-line, MySQL shell and PHPMyAdmin. You are now ready to <a href=\"https:\/\/dev.mysql.com\/doc\/\">expand your knowledge<\/a> of database management systems.<\/p>\n<!-- AddThis Advanced Settings generic via filter on the_content --><!-- AddThis Share Buttons generic via filter on the_content -->","protected":false},"excerpt":{"rendered":"<p>If you are a database administrator, you should familiar with MySQL environment and know how to manage MySQL from command-line. One of the most common task is to show a list of MySQL databases available in the server. There are several to show list of MySQL databases in Linux operating systems. In this tutorial, we<!-- AddThis Advanced Settings generic via filter on get_the_excerpt --><!-- AddThis Share Buttons generic via filter on get_the_excerpt --><\/p>\n","protected":false},"author":3,"featured_media":4894,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[61],"tags":[],"class_list":["post-4892","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-database"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.0 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to show list of MySQL databases - Globo.Tech<\/title>\n<meta name=\"description\" content=\"MySQL is an open-source relational database management system. It&#039;s one of the most popular DB engine for Linux. Learn how to show list MySQL databases.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.globo.tech\/learning-center\/how-to-show-list-of-mysql-databases\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to show list of MySQL databases - Globo.Tech\" \/>\n<meta property=\"og:description\" content=\"MySQL is an open-source relational database management system. It&#039;s one of the most popular DB engine for Linux. Learn how to show list MySQL databases.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.globo.tech\/learning-center\/how-to-show-list-of-mysql-databases\/\" \/>\n<meta property=\"og:site_name\" content=\"Globo.Tech\" \/>\n<meta property=\"article:published_time\" content=\"2020-03-13T17:20:46+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-03-13T17:20:47+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.globo.tech\/learning-center\/wp-content\/uploads\/2020\/03\/HowToShowListMySQLDatabases-1.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"628\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"GloboTech Communications\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"GloboTech Communications\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.globo.tech\/learning-center\/how-to-show-list-of-mysql-databases\/\",\"url\":\"https:\/\/www.globo.tech\/learning-center\/how-to-show-list-of-mysql-databases\/\",\"name\":\"How to show list of MySQL databases - Globo.Tech\",\"isPartOf\":{\"@id\":\"https:\/\/www.globo.tech\/learning-center\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.globo.tech\/learning-center\/how-to-show-list-of-mysql-databases\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.globo.tech\/learning-center\/how-to-show-list-of-mysql-databases\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.globo.tech\/learning-center\/wp-content\/uploads\/2020\/03\/HowToShowListMySQLDatabases-1.jpg\",\"datePublished\":\"2020-03-13T17:20:46+00:00\",\"dateModified\":\"2020-03-13T17:20:47+00:00\",\"author\":{\"@id\":\"https:\/\/www.globo.tech\/learning-center\/#\/schema\/person\/e17784b37f4a4f49b7bc611847912e87\"},\"description\":\"MySQL is an open-source relational database management system. It's one of the most popular DB engine for Linux. Learn how to show list MySQL databases.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.globo.tech\/learning-center\/how-to-show-list-of-mysql-databases\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.globo.tech\/learning-center\/how-to-show-list-of-mysql-databases\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.globo.tech\/learning-center\/how-to-show-list-of-mysql-databases\/#primaryimage\",\"url\":\"https:\/\/www.globo.tech\/learning-center\/wp-content\/uploads\/2020\/03\/HowToShowListMySQLDatabases-1.jpg\",\"contentUrl\":\"https:\/\/www.globo.tech\/learning-center\/wp-content\/uploads\/2020\/03\/HowToShowListMySQLDatabases-1.jpg\",\"width\":1200,\"height\":628,\"caption\":\"How to show list of MySQL Databases\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.globo.tech\/learning-center\/how-to-show-list-of-mysql-databases\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.globo.tech\/learning-center\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to show list of MySQL databases\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.globo.tech\/learning-center\/#website\",\"url\":\"https:\/\/www.globo.tech\/learning-center\/\",\"name\":\"Globo.Tech\",\"description\":\"Welcome to the Official Globo.Tech Learning Center\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.globo.tech\/learning-center\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.globo.tech\/learning-center\/#\/schema\/person\/e17784b37f4a4f49b7bc611847912e87\",\"name\":\"GloboTech Communications\",\"sameAs\":[\"http:\/\/www.gtcomm.net\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to show list of MySQL databases - Globo.Tech","description":"MySQL is an open-source relational database management system. It's one of the most popular DB engine for Linux. Learn how to show list MySQL databases.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.globo.tech\/learning-center\/how-to-show-list-of-mysql-databases\/","og_locale":"en_US","og_type":"article","og_title":"How to show list of MySQL databases - Globo.Tech","og_description":"MySQL is an open-source relational database management system. It's one of the most popular DB engine for Linux. Learn how to show list MySQL databases.","og_url":"https:\/\/www.globo.tech\/learning-center\/how-to-show-list-of-mysql-databases\/","og_site_name":"Globo.Tech","article_published_time":"2020-03-13T17:20:46+00:00","article_modified_time":"2020-03-13T17:20:47+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/www.globo.tech\/learning-center\/wp-content\/uploads\/2020\/03\/HowToShowListMySQLDatabases-1.jpg","type":"image\/jpeg"}],"author":"GloboTech Communications","twitter_misc":{"Written by":"GloboTech Communications","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.globo.tech\/learning-center\/how-to-show-list-of-mysql-databases\/","url":"https:\/\/www.globo.tech\/learning-center\/how-to-show-list-of-mysql-databases\/","name":"How to show list of MySQL databases - Globo.Tech","isPartOf":{"@id":"https:\/\/www.globo.tech\/learning-center\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.globo.tech\/learning-center\/how-to-show-list-of-mysql-databases\/#primaryimage"},"image":{"@id":"https:\/\/www.globo.tech\/learning-center\/how-to-show-list-of-mysql-databases\/#primaryimage"},"thumbnailUrl":"https:\/\/www.globo.tech\/learning-center\/wp-content\/uploads\/2020\/03\/HowToShowListMySQLDatabases-1.jpg","datePublished":"2020-03-13T17:20:46+00:00","dateModified":"2020-03-13T17:20:47+00:00","author":{"@id":"https:\/\/www.globo.tech\/learning-center\/#\/schema\/person\/e17784b37f4a4f49b7bc611847912e87"},"description":"MySQL is an open-source relational database management system. It's one of the most popular DB engine for Linux. Learn how to show list MySQL databases.","breadcrumb":{"@id":"https:\/\/www.globo.tech\/learning-center\/how-to-show-list-of-mysql-databases\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.globo.tech\/learning-center\/how-to-show-list-of-mysql-databases\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.globo.tech\/learning-center\/how-to-show-list-of-mysql-databases\/#primaryimage","url":"https:\/\/www.globo.tech\/learning-center\/wp-content\/uploads\/2020\/03\/HowToShowListMySQLDatabases-1.jpg","contentUrl":"https:\/\/www.globo.tech\/learning-center\/wp-content\/uploads\/2020\/03\/HowToShowListMySQLDatabases-1.jpg","width":1200,"height":628,"caption":"How to show list of MySQL Databases"},{"@type":"BreadcrumbList","@id":"https:\/\/www.globo.tech\/learning-center\/how-to-show-list-of-mysql-databases\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.globo.tech\/learning-center\/"},{"@type":"ListItem","position":2,"name":"How to show list of MySQL databases"}]},{"@type":"WebSite","@id":"https:\/\/www.globo.tech\/learning-center\/#website","url":"https:\/\/www.globo.tech\/learning-center\/","name":"Globo.Tech","description":"Welcome to the Official Globo.Tech Learning Center","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.globo.tech\/learning-center\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.globo.tech\/learning-center\/#\/schema\/person\/e17784b37f4a4f49b7bc611847912e87","name":"GloboTech Communications","sameAs":["http:\/\/www.gtcomm.net"]}]}},"_links":{"self":[{"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/posts\/4892","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/comments?post=4892"}],"version-history":[{"count":4,"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/posts\/4892\/revisions"}],"predecessor-version":[{"id":4906,"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/posts\/4892\/revisions\/4906"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/media\/4894"}],"wp:attachment":[{"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/media?parent=4892"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/categories?post=4892"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/tags?post=4892"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}