{"id":1191,"date":"2021-09-06T15:09:20","date_gmt":"2021-09-06T09:39:20","guid":{"rendered":"http:\/\/www.webhostingchennai.co.in\/blog\/?p=1191"},"modified":"2021-09-27T17:19:52","modified_gmt":"2021-09-27T11:49:52","slug":"4-useful-command-line-tools-to-monitor-mysql-performance-in-linux","status":"publish","type":"post","link":"https:\/\/chennaiwebhosting.in\/blog\/4-useful-command-line-tools-to-monitor-mysql-performance-in-linux\/","title":{"rendered":"4 Useful command line tools to monitor MySQL performance in Linux"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_80 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/chennaiwebhosting.in\/blog\/4-useful-command-line-tools-to-monitor-mysql-performance-in-linux\/#4_Useful_command_line_tools_to_monitor_MySQL_performance_in_Linux\" >4 Useful command line tools to monitor MySQL performance in Linux<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/chennaiwebhosting.in\/blog\/4-useful-command-line-tools-to-monitor-mysql-performance-in-linux\/#Mytop\" >Mytop<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/chennaiwebhosting.in\/blog\/4-useful-command-line-tools-to-monitor-mysql-performance-in-linux\/#Mtop\" >Mtop<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/chennaiwebhosting.in\/blog\/4-useful-command-line-tools-to-monitor-mysql-performance-in-linux\/#mysqladmin\" >mysqladmin<\/a><\/li><\/ul><\/nav><\/div>\n<h4><span class=\"ez-toc-section\" id=\"4_Useful_command_line_tools_to_monitor_MySQL_performance_in_Linux\"><\/span><span style=\"text-decoration: underline;\">4 Useful command line tools to monitor MySQL performance in Linux<\/span><span class=\"ez-toc-section-end\"><\/span><\/h4>\n<p>There are many tools to monitor MySQL performance and troubleshoot a server, but in some cases they don\u2019t always perfect match for a MySQL developer or administrator\u2019s for their common needs, or may not work in some criteria, such as remote or over the web monitoring.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-238\" src=\"http:\/\/chennaihosting.net\/blog\/wp-content\/uploads\/2019\/03\/mysqlmonit.png\" alt=\"4 Useful command line tools to monitor MySQL\" width=\"484\" height=\"286\" \/><\/p>\n<p>There are variety of open source tools created by MySQL community to fill the needs. Also, it\u2019s very difficult to locate these tools via web searches, that\u2019s the reason we\u2019ve selected h 4 command line tools to monitor MySQL database uptime, load and performance in <a href=\"https:\/\/www.squarebrothers.com\/dedicated-server-in-india\/\" rel=\"nofollow noopener\" target=\"_blank\">Linux servers<\/a>.<\/p>\n<p>Uptime means how long the database has been running and up since its last shutdown or restart. Getting information about uptime is very crucial in many situations, as it helps system administrators to check the status of MySQL database about, how many queries per second that MySQL database serves, threads, slow queries and lots of interesting statistics.<\/p>\n<p>First let see what are the 4 command line tools<\/p>\n<ol>\n<li>Mytop<\/li>\n<li>Mtop<\/li>\n<li>Innotop<\/li>\n<li>mysqladmin<\/li>\n<\/ol>\n<p>Let see one by one tools and their features.<\/p>\n<h4><span class=\"ez-toc-section\" id=\"Mytop\"><\/span>Mytop<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<p>Mytop is one of my classic open source and free console-based (non-gui) monitoring tool for MySQL database was written by Jereme Zawodny using Perl language. Mytop runs in a terminal and displays statistics about threads, queries, slow queries, uptime, load, etc. in tabular format, much similar to the Linux top program. Which indirectly helps the administrators to optimize and improve performance of MySQl to handle large requests and decrease server load.<\/p>\n<p>There are mytop packages available for various Linux distributions, such as <strong>Ubuntu<\/strong>, <strong>Fedora<\/strong> and <strong>CentOS<\/strong>. For more about installation instruction read: <a href=\"http:\/\/www.webhostingchennai.co.in\/blog\/mytop-a-useful-tool-for-monitoring\/\" rel=\"nofollow noopener\" target=\"_blank\">How to Install Mytop (MySQL Monitoring) in Linux<\/a><\/p>\n<h4><span class=\"ez-toc-section\" id=\"Mtop\"><\/span>Mtop<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<p>mtop (MySQL top) is a another similar open source, command line based real time MYSQL Server monitoring tool, was written in Perl language that display results in tabular format much like mytop. mtop monitors MySQL queries which are taking the most amount of time to finish and kills those long running queries after certain specified time.<\/p>\n<p>In addition, it also enable us to identify performance related problems, configuration information, performance statistics and tuning related tips from the command line interface. The two tools are very similar, but mtop is not actively maintained and may not work on newly installed MySQL versions.<\/p>\n<p>&nbsp;<\/p>\n<p><strong>Innotop<\/strong><\/p>\n<p><strong>Innotop<\/strong> is a real time advanced command line based investigation program to monitor local and remote MySQL servers running under<strong> InnoDB<\/strong> engine. Innotop includes many features and comes with different types of modes\/options, which helps us to monitor various aspects of MySQL performance to find out what\u2019s wrong going with MySQL server.<\/p>\n<p>&nbsp;<\/p>\n<h4><span class=\"ez-toc-section\" id=\"mysqladmin\"><\/span>mysqladmin<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<p>mysqladmin is a default command line MySQL client that comes pre-installed with MySQL package for performing administrative operations such as monitoring processes, checking server configuration, reloading privileges, current status, setting root password, changing root password, create\/drop databases, and much more.<\/p>\n<p>To check the mysql status as well as uptime run the following command from the terminal, and make sure you must have root permission to execute the command from the shell.<\/p>\n<pre>[root@localhost ~]# mysqladmin -u root -p version\r\nEnter password:<\/pre>\n<p><strong>Output<\/strong><\/p>\n<pre>mysqladmin  Ver 8.42 Distrib 5.1.61, for redhat-linux-gnu on i386\r\nCopyright (c) 2000, 2011, Oracle and\/or its affiliates. All rights reserved.\r\n\r\nOracle is a registered trademark of Oracle Corporation and\/or its\r\naffiliates. Other names may be trademarks of their respective\r\nowners.\r\n\r\nServer version\t\t5.6 -log\r\nProtocol version\t10\r\nConnection\t\tLocalhost via UNIX socket\r\nUNIX socket\t\t\/var\/lib\/mysql\/mysql.sock\r\nUptime:\t\t\t2 days 54 min 30 sec\r\n\r\nThreads: 1  Questions: 149941143  Slow queries: 21  Opens: 752  Flush tables: 1  Open tables: 745  Queries per second avg: 86.607<\/pre>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>4 Useful command line tools to monitor MySQL performance in Linux There are many tools to monitor MySQL performance and troubleshoot a server, but in some cases they don\u2019t always perfect match for a MySQL developer or administrator\u2019s for their common needs, or may not work in some criteria, such as remote or over the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":1558,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"footnotes":""},"categories":[11,79],"tags":[81,82],"class_list":["post-1191","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux","category-mysql","tag-mysql-command-line-tools","tag-mysql-monitoring-tool"],"_links":{"self":[{"href":"https:\/\/chennaiwebhosting.in\/blog\/wp-json\/wp\/v2\/posts\/1191","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/chennaiwebhosting.in\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/chennaiwebhosting.in\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/chennaiwebhosting.in\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/chennaiwebhosting.in\/blog\/wp-json\/wp\/v2\/comments?post=1191"}],"version-history":[{"count":1,"href":"https:\/\/chennaiwebhosting.in\/blog\/wp-json\/wp\/v2\/posts\/1191\/revisions"}],"predecessor-version":[{"id":1541,"href":"https:\/\/chennaiwebhosting.in\/blog\/wp-json\/wp\/v2\/posts\/1191\/revisions\/1541"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/chennaiwebhosting.in\/blog\/wp-json\/wp\/v2\/media\/1558"}],"wp:attachment":[{"href":"https:\/\/chennaiwebhosting.in\/blog\/wp-json\/wp\/v2\/media?parent=1191"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/chennaiwebhosting.in\/blog\/wp-json\/wp\/v2\/categories?post=1191"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/chennaiwebhosting.in\/blog\/wp-json\/wp\/v2\/tags?post=1191"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}