{"id":797,"date":"2021-07-16T13:08:00","date_gmt":"2021-07-16T17:08:00","guid":{"rendered":"https:\/\/molecularsciences.org\/content\/?p=797"},"modified":"2024-02-09T14:46:47","modified_gmt":"2024-02-09T19:46:47","slug":"listing-all-tables-and-their-table-counts-in-a-mysql-database","status":"publish","type":"post","link":"https:\/\/molecularsciences.org\/content\/listing-all-tables-and-their-table-counts-in-a-mysql-database\/","title":{"rendered":"Listing all tables and their table counts in a MySQL database"},"content":{"rendered":"\n<p>The Following SQL query will list all tables in a MySQL database and also list the row counts for each.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>SELECT TABLE_NAME, TABLE_ROWS \nFROM `information_schema`.`tables` \nWHERE `table_schema` = 'mydatabase';\n<\/code><\/pre>\n\n\n\n<p>where mydatabase is the name or your database. The output will like something like the following:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>+------------+------------+\n| table_name | table_rows |\n+------------+------------+\n| lines      |       2271 |\n| links      |        484 |\n| word       |      25004 |\n+------------+------------+<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>The Following SQL query will list all tables in a MySQL database and also list the row counts for each. where mydatabase is the name or your database. The output will like something like the following:<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16,204],"tags":[14,27],"class_list":["post-797","post","type-post","status-publish","format-standard","hentry","category-database","category-mysql","tag-database","tag-mysql"],"_links":{"self":[{"href":"https:\/\/molecularsciences.org\/content\/wp-json\/wp\/v2\/posts\/797","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/molecularsciences.org\/content\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/molecularsciences.org\/content\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/molecularsciences.org\/content\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/molecularsciences.org\/content\/wp-json\/wp\/v2\/comments?post=797"}],"version-history":[{"count":1,"href":"https:\/\/molecularsciences.org\/content\/wp-json\/wp\/v2\/posts\/797\/revisions"}],"predecessor-version":[{"id":798,"href":"https:\/\/molecularsciences.org\/content\/wp-json\/wp\/v2\/posts\/797\/revisions\/798"}],"wp:attachment":[{"href":"https:\/\/molecularsciences.org\/content\/wp-json\/wp\/v2\/media?parent=797"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/molecularsciences.org\/content\/wp-json\/wp\/v2\/categories?post=797"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/molecularsciences.org\/content\/wp-json\/wp\/v2\/tags?post=797"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}