{"id":9808,"date":"2021-09-07T17:17:21","date_gmt":"2021-09-07T17:17:21","guid":{"rendered":"https:\/\/linuxways.net\/?p=9808"},"modified":"2021-09-07T17:17:21","modified_gmt":"2021-09-07T17:17:21","slug":"list-tables-in-a-mysql-database","status":"publish","type":"post","link":"https:\/\/linuxways.net\/de\/centos\/list-tables-in-a-mysql-database\/","title":{"rendered":"List Tables in a MySQL Database"},"content":{"rendered":"<h2>Introduction<\/h2>\n<p>When working with MySQL databases, you usually have to list the database tables or perform some commands to retrieve the common information of DB as well.<\/p>\n<p>This article will show you the way to list tables in the MySQL database by using the command line.<\/p>\n<h2>Show Tables in MySQL database<\/h2>\n<p>Firstly, you have to connect to the MySQL server by running the following command<\/p>\n<pre>$ mysql -u user -p<\/pre>\n<p>For example:<\/p>\n<pre>$ mysql -u karim -p<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1374\" height=\"544\" class=\"wp-image-9809\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-61.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-61.png 1374w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-61-300x119.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-61-1024x405.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-61-768x304.png 768w\" sizes=\"auto, (max-width: 1374px) 100vw, 1374px\" \/><\/p>\n<p>In the MySQL shell, let\u2019s choose the database we will work on:<\/p>\n<pre>mysql&gt; USE database-name;<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1310\" height=\"268\" class=\"wp-image-9810\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-62.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-62.png 1310w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-62-300x61.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-62-1024x209.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-62-768x157.png 768w\" sizes=\"auto, (max-width: 1310px) 100vw, 1310px\" \/><\/p>\n<p>In order to list all of the tables in the current chosen database, run the following command<\/p>\n<pre>mysql&gt; SHOW tables;<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1330\" height=\"378\" class=\"wp-image-9811\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-63.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-63.png 1330w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-63-300x85.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-63-1024x291.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-63-768x218.png 768w\" sizes=\"auto, (max-width: 1330px) 100vw, 1330px\" \/><\/p>\n<p>If you want to list the tables with their type, run:<\/p>\n<pre>mysql&gt; SHOW FULL tables;<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1324\" height=\"388\" class=\"wp-image-9812\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-64.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-64.png 1324w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-64-300x88.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-64-1024x300.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-64-768x225.png 768w\" sizes=\"auto, (max-width: 1324px) 100vw, 1324px\" \/><\/p>\n<h2>Conclusion<\/h2>\n<p>You\u2019ve already go through the details of how to get information of the tables in the MySQL database.<\/p>\n<p>If you have any concerns, please let me know. Thank you for reading.<\/p>","protected":false},"excerpt":{"rendered":"<p>Introduction When working with MySQL databases, you usually have to list the database tables or perform some commands to retrieve the common information of DB as well. This&hellip;<\/p>","protected":false},"author":1,"featured_media":9883,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1,4,5,83,165,2],"tags":[27],"class_list":["post-9808","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-centos","category-debian","category-mint","category-opensuse","category-red-hat","category-ubuntu","tag-mysql"],"_links":{"self":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/9808","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/comments?post=9808"}],"version-history":[{"count":0,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/9808\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media\/9883"}],"wp:attachment":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media?parent=9808"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/categories?post=9808"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/tags?post=9808"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}