{"id":1181,"date":"2021-04-07T15:46:11","date_gmt":"2021-04-07T12:46:11","guid":{"rendered":"https:\/\/www.scalahosting.com\/kb\/?p=1181"},"modified":"2022-05-11T17:58:56","modified_gmt":"2022-05-11T14:58:56","slug":"how-to-check-mysql-version-via-the-command-line","status":"publish","type":"post","link":"https:\/\/www.scalahosting.com\/kb\/how-to-check-mysql-version-via-the-command-line\/","title":{"rendered":"How to Check MySQL Version via The Command Line"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\"><b>Most web applications run thanks to MySQL databases.<\/b><span style=\"font-weight: 400;\"> Aside from being free (a paid proprietary enterprise solution exists but is not required for most projects), the software is impressively reliable. It\u2019s also easy to use and super secure.<\/span><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"font-weight: 400;\">MySQL can handle millions of queries and supports<\/span><b> high-speed transactional processing for eCommerce websites.<\/b><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><b>The first version of MySQL appeared in 1995, <\/b><span style=\"font-weight: 400;\">and today, over ten other versions exist.<\/span><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"font-weight: 400;\">Knowing your MySQL version will help you figure out whether you need to make any configuration changes and tweak settings to keep your applications running perfectly.<\/span><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"font-weight: 400;\">This article will help you find <\/span><b>the MySQL version via the command line<\/b><span style=\"font-weight: 400;\">.<\/span><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><b>Method 1: SSH Shell<\/b><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"font-weight: 400;\">The secured socket shell is a network protocol that <\/span><b>allows two computers to communicate and reliably share data.&nbsp;<\/b><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"font-weight: 400;\">Webmasters and Database Administrators often use SSH to log into a remote computer and perform tasks on the server from anywhere. It&#8217;s basically the same as hooking up a monitor and a keyboard to the server.<\/span><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"font-weight: 400;\">SSH connections are end-to-end encrypted, so you don&#8217;t need to worry about anyone eavesdropping the communication between your computer and the remote host.<\/span><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"font-weight: 400;\">There are a couple of ways of establishing an <a href=\"https:\/\/www.scalahosting.com\/kb\/how-to-enable-ssh-access\/\">SSH<\/a> connection to your server: you can either use a client application like PuTTY, or you can do it via your operating system&#8217;s built-in command line shell. Windows users can employ PowerShell or the command prompt and Linux and MacOS have the Terminal.<\/span><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"font-weight: 400;\">To check the version your <\/span><a href=\"https:\/\/www.scalahosting.com\/kb\/how-to-import-and-export-a-mysql-database\/\"><span style=\"font-weight: 400;\">MySQL<\/span><\/a><span style=\"font-weight: 400;\"> is running, type and execute <\/span><b><i>mysql -V&nbsp;<\/i><\/b>(note the uppercase V)<span style=\"font-weight: 400;\"> in the command line.<\/span><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"font-weight: 400;\">MySQL will return a result that looks like this:<\/span><\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img decoding=\"async\" width=\"596\" height=\"168\" src=\"https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/04\/296.png\" alt=\"How to Check MySQL Version via The Command Line, Method 1: SSH Shell\" class=\"wp-image-3790\" srcset=\"https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/04\/296.png 596w, https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/04\/296-300x85.png 300w\" sizes=\"(max-width: 361px) 660px, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 910px, 1140px\" \/><\/figure><\/div>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"font-weight: 400;\">As you can see, the MySQL version for this system is <\/span><b>10.4.12<\/b><span style=\"font-weight: 400;\">.<\/span><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><b>Method 2: MySQL Shell<\/b><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"font-weight: 400;\">The MySQL Shell is an advanced client and code editor for MySQL. It provides scripting capabilities for <\/span><b>JavaScript and Python and includes APIs for working with MySQL.<\/b><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"font-weight: 400;\">Webmasters use MySQL shell to perform data queries and updates, as well as various administrative operations.<\/span><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><b>To check the MySQL version from the MySQL Shell,<\/b><span style=\"font-weight: 400;\"> you simply need to log into it. The command you need looks like this:<\/span><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><em><strong>$ mysql -u [your MySQL username] -p<\/strong><\/em><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">MySQL will ask you for the user&#8217;s password and after you enter it, it will display the version automatically.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img decoding=\"async\" width=\"581\" height=\"174\" src=\"https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/04\/297.png\" alt=\"How to Check MySQL Version via The Command Line, Method 2: MySQL Shell\" class=\"wp-image-3791\" srcset=\"https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/04\/297.png 581w, https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/04\/297-300x90.png 300w\" sizes=\"(max-width: 361px) 660px, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 910px, 1140px\" \/><\/figure><\/div>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"font-weight: 400;\">Once you&#8217;re logged in, you can also find the MySQL version using the following command:<br><\/span><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong><i>show variables like \u2018%version%\u2019;<\/i><\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"font-weight: 400;\">MySQL will return the version result after executing the command:<\/span><\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img decoding=\"async\" width=\"586\" height=\"330\" src=\"https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/04\/298.png\" alt=\"How to Check MySQL Version via The Command Line, Method 2: MySQL Shell 2\" class=\"wp-image-3793\" srcset=\"https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/04\/298.png 586w, https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/04\/298-300x169.png 300w\" sizes=\"(max-width: 361px) 660px, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 910px, 1140px\" \/><\/figure><\/div>\n\n\n\n<h2 class=\"wp-block-heading\"><b>Understanding The MySQL Naming Scheme<\/b><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"font-weight: 400;\">Always make sure to run the latest MySQL version on your server.<\/span><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"font-weight: 400;\">Install only the latest MySQL General Availability (GA) release. The GA releases are MySQL stable versions and are safe and reliably for production uses. Although developmental releases have the newest features, they are not suitable for production uses.<\/span><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"font-weight: 400;\">MySQL 8.0.28 is the latest MySQL version.&nbsp;<\/span><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"font-weight: 400;\">The naming scheme uses release names that consist of<\/span><b> three numbers and an optional suffix, <\/b><span style=\"font-weight: 400;\">for example,<\/span><i><span style=\"font-weight: 400;\"> mysql-8.0.1-dmr<\/span><\/i><span style=\"font-weight: 400;\">.<\/span><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"font-weight: 400;\">Understanding the naming scheme will enable you to know the correct version to install. Here\u2019s how to interpret a MySQL version number.<\/span><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">The first number shows<\/span><b> the major version number. <\/b><span style=\"font-weight: 400;\">In the above case, it\u2019s eight.<\/span><\/li><li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">The second number <\/span><b>shows the minor version number<\/b><span style=\"font-weight: 400;\">. In the example above, it\u2019s zero. The major and minor version numbers constitute the release series number, and it describes the stable feature.<\/span><\/li><li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">T<\/span><b>he third number shows the number for each bug-fix release.<\/b><span style=\"font-weight: 400;\"> The version with the latest bug-fix makes the best choice, of course, in most cases.<\/span><\/li><li style=\"font-weight: 400;\" aria-level=\"1\"><b>The suffix indicates the stability level of each release.<\/b><span style=\"font-weight: 400;\"> Two possible suffixes are dmr and rc. The former stands for Development Milestone Releases, while the latter stands for Release Candidate.<\/span><\/li><\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"font-weight: 400;\">New features with dmr releases are not thoroughly certified for production uses.&nbsp;<\/span><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"font-weight: 400;\">Release Candidate is the second development stage in the series.<\/span><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"font-weight: 400;\">Although the vendors believe <\/span><b>the RC series is relatively stable,<\/b><span style=\"font-weight: 400;\"> their efforts shift to fixing bugs to stabilize the features. They might also introduce new features at this stage.<\/span><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"font-weight: 400;\">MySQL versions without any suffix are pretty stable, free of bugs and suitable for production uses. They have attained the <\/span><b>GA status.<\/b><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><b>Wrapping It Up<\/b><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><b>Running the latest stable version of MySQL<\/b><span style=\"font-weight: 400;\"> enables you to enjoy the newest features and have software free of bugs. You can always check your MySQL by<\/span><b> following the steps we outlined above<\/b><span style=\"font-weight: 400;\">. You can always contact Support whenever you need help.<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Most web applications run thanks to MySQL databases. Aside from being free (a paid proprietary enterprise solution exists but is not required for most projects), the software is impressively reliable. It\u2019s also easy to use and super secure. MySQL can handle millions of queries and supports high-speed transactional processing for eCommerce websites. The first version [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_seopress_titles_title":"","_seopress_titles_desc":"","_seopress_robots_index":"","_seopress_robots_follow":"","_seopress_robots_imageindex":"","_seopress_robots_snippet":"","_seopress_robots_primary_cat":"","_seopress_robots_breadcrumbs":"","_seopress_robots_freeze_modified_date":"","_seopress_robots_custom_modified_date":"","_seopress_robots_canonical":"","_seopress_social_fb_title":"","_seopress_social_fb_desc":"","_seopress_social_fb_img":"","_seopress_social_fb_img_attachment_id":0,"_seopress_social_fb_img_width":0,"_seopress_social_fb_img_height":0,"_seopress_social_twitter_title":"","_seopress_social_twitter_desc":"","_seopress_social_twitter_img":"","_seopress_social_twitter_img_attachment_id":0,"_seopress_social_twitter_img_width":0,"_seopress_social_twitter_img_height":0,"_seopress_redirections_value":"","_seopress_redirections_enabled":"","_seopress_redirections_enabled_regex":"","_seopress_redirections_logged_status":"","_seopress_redirections_param":"","_seopress_redirections_type":0,"_seopress_analysis_target_kw":"","_seopress_news_disabled":"","_seopress_video_disabled":"","_seopress_video":[],"_seopress_pro_schemas_manual":[],"_seopress_pro_rich_snippets_disable_all":"","_seopress_pro_rich_snippets_disable":[],"_seopress_pro_schemas":[],"footnotes":""},"categories":[34],"tags":[],"class_list":["post-1181","post","type-post","status-publish","format-standard","hentry","category-web-hosting"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.scalahosting.com\/kb\/wp-json\/wp\/v2\/posts\/1181","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.scalahosting.com\/kb\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.scalahosting.com\/kb\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.scalahosting.com\/kb\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.scalahosting.com\/kb\/wp-json\/wp\/v2\/comments?post=1181"}],"version-history":[{"count":5,"href":"https:\/\/www.scalahosting.com\/kb\/wp-json\/wp\/v2\/posts\/1181\/revisions"}],"predecessor-version":[{"id":4445,"href":"https:\/\/www.scalahosting.com\/kb\/wp-json\/wp\/v2\/posts\/1181\/revisions\/4445"}],"wp:attachment":[{"href":"https:\/\/www.scalahosting.com\/kb\/wp-json\/wp\/v2\/media?parent=1181"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.scalahosting.com\/kb\/wp-json\/wp\/v2\/categories?post=1181"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.scalahosting.com\/kb\/wp-json\/wp\/v2\/tags?post=1181"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}