{"id":4061,"date":"2022-10-10T11:27:02","date_gmt":"2022-10-10T11:27:02","guid":{"rendered":"https:\/\/arzhost.com\/blogs\/?p=4061"},"modified":"2024-12-07T20:56:00","modified_gmt":"2024-12-07T15:56:00","slug":"how-to-check-version-mysql-in-linux","status":"publish","type":"post","link":"https:\/\/arzhost.com\/blogs\/how-to-check-version-mysql-in-linux\/","title":{"rendered":"How to Check Version MySQL in Linux?"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">Overview of MySQL Database Management<\/h2>\n\n\n\n<p>How to Check Version MySQL in Linux? The most widely used open-source relational database management system is <a href=\"https:\/\/en.wikipedia.org\/wiki\/MySQL\">MySQL<\/a> (and its direct replacement Maria DB). Knowing which version of MySQL is installed on your server may be crucial in particular circumstances because there are some significant differences between them.<\/p>\n\n\n\n<p>For instance, you must first determine the version of your MySQL server if you are installing an application that needs a specific version of MySQL in order to complete the installation.<\/p>\n\n\n\n<p><iframe title=\"YouTube video player\" src=\"https:\/\/www.youtube.com\/embed\/n5rbAo_PL9w\" width=\"560\" height=\"315\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/p>\n\n\n\n<p>This article from our <a href=\"https:\/\/arzhost.com\/blogs\/\"><strong>blog<\/strong><\/a> will demonstrate <span style=\"color: #000000;\"><strong>How to Check Version MySQL in Linux?<\/strong><\/span> or <strong>Maria DB server<\/strong> is currently installed on your computer.<\/p>\n\n\n\n<div class=\"wp-block-uagb-call-to-action uagb-block-ea34b2e4 wp-block-button uag-blocks-common-selector\" style=\"--z-index-desktop:479;;--z-index-tablet:undefined;;--z-index-mobile:undefined;\"><div class=\"uagb-cta__wrap\"><h2 class=\"uagb-cta__title\"><a href=\"https:\/\/arzhost.com\/web-hosting\/\" data-type=\"link\" data-id=\"https:\/\/arzhost.com\/web-hosting\/\">Lock in Your Hosting Discount\u2014Act Fast and Save Up to 90%!<\/a><\/h2><p class=\"uagb-cta__desc\">Save Big on Quality Hosting at <a href=\"https:\/\/arzhost.com\/\" data-type=\"link\" data-id=\"https:\/\/arzhost.com\/\">ARZ Host<\/a>\u2014Unlock Up to 90% Off Today!<\/p><\/div><div class=\"uagb-cta__buttons\"><a href=\"https:\/\/arzhost.com\/web-hosting\/\" class=\"uagb-cta__button-link-wrapper wp-block-button__link\" target=\"_self\" rel=\"noopener noreferrer\">Read More<\/a><\/div><\/div>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Steps to Access MySQL via Command Line: Key Commands<\/strong><\/h2>\n\n\n\n<p>You may find the version of your MySQL by using a number of different commands assuming you have SSH access to the server.<\/p>\n\n\n\n<p><u>MySQL is the name of the MySQL server binary. Run the program while using the version or -V option to obtain the server version:<\/u><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>-version MySQL<\/code><\/li>\n<\/ul>\n\n\n\n<p><u>The command will exit after printing information about the version of MySQL. The MySQL server used in this example is version 5.7.27:<\/u><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>Linux on x86 64 using MySQL version 5.7.27-0ubuntu0.18.04.1 (Ubuntu)<\/code><\/li>\n<\/ul>\n\n\n\n<p><u>The client utility mysqladmin is used to carry out administrative tasks on the MySQL servers. Additionally, it can be used to check the MySQL version:<\/u><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>-V mysqladmin<\/code><\/li>\n<\/ul>\n\n\n\n<p><u>The results will differ slightly from the preceding commands:<\/u><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>mysqladmin Ver 8.42 Distrib 5.7.27, for Linux on x86_64<\/code><\/li>\n<\/ul>\n\n\n\n<p><strong>Related Article: <a href=\"https:\/\/arzhost.com\/blogs\/fix-mysql-command-not-found\/\">How to Fix MySQL \u201cCommand Not Found\u201d<\/a><\/strong><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Benefits of Using MySQL Shell for Database Management<\/strong><\/h2>\n\n\n\n<p>The version of the MySQL server can also be found by using a command-line client tool like MySQL.<\/p>\n\n\n\n<p><u>Type MySQL to connect to the MySQL server:<\/u><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>MySQL<\/code><\/li>\n<\/ul>\n\n\n\n<p><u>The version will be displayed on the screen after you are connected to the MySQL shell:<\/u><\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><code>This is the MySQL monitor, welcome. Commands have a; or g at the end.<\/code><\/li>\n\n\n\n<li><code>It is 3 for your MySQL connection id.<\/code><\/li>\n\n\n\n<li><code>Version 5.7.27-0ubuntu0.18.04.1 of the server (Ubuntu)<\/code><\/li>\n<\/ol>\n\n\n\n<p><u>Use the version variables to perform a query to obtain details about the MySQL version and other components:<\/u><\/p>\n\n\n\n<p class=\"has-text-align-center\"><strong><u>SHOW VARIABLES LIKE &#8220;%version%&#8221;;<\/u><\/strong><\/p>\n\n\n\n<p class=\"has-text-align-center\"><strong>+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+<\/strong><\/p>\n\n\n\n<p class=\"has-text-align-center\"><strong>| Variable name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | Value&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |<\/strong><\/p>\n\n\n\n<p class=\"has-text-align-center\"><strong>+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+<\/strong><\/p>\n\n\n\n<p class=\"has-text-align-center\"><strong>| innodb_version&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | 5.7.27&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |<\/strong><\/p>\n\n\n\n<p class=\"has-text-align-center\"><strong>| protocol version&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | 10&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |<\/strong><\/p>\n\n\n\n<p class=\"has-text-align-center\"><strong>| slave_type_conversions |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |<\/strong><\/p>\n\n\n\n<p class=\"has-text-align-center\"><strong>| tls_version&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | TLSv1, TLSv1.1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |<\/strong><\/p>\n\n\n\n<p class=\"has-text-align-center\"><strong>| version&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | 5.7.27-0ubuntu0.18.04.1 |<\/strong><\/p>\n\n\n\n<p class=\"has-text-align-center\"><strong>| version comment&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | (Ubuntu)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |<\/strong><\/p>\n\n\n\n<p class=\"has-text-align-center\"><strong>| version_compile_machine | x86_64&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |<\/strong><\/p>\n\n\n\n<p class=\"has-text-align-center\"><strong>| version_compile_os&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | Linux&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |<\/strong><\/p>\n\n\n\n<p class=\"has-text-align-center\"><strong>+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+<\/strong><\/p>\n\n\n\n<p class=\"has-text-align-center\"><strong>8 rows in set (0.02 sec)<\/strong><\/p>\n\n\n\n<p>Additional clauses and procedures might also display the server version for you. Only the MySQL version will be shown by the SELECT VERSION () command.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>SELECT VERSION () in MySQL<\/code><\/li>\n<\/ul>\n\n\n\n<p><u>The STATUS command displays the version of MySQL as well as details about the server&#8217;s status:<\/u><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>MYSQL>STATUS<\/code><\/li>\n<\/ul>\n\n\n\n<p>See more about MySQL in our article <a href=\"https:\/\/arzhost.com\/blogs\/fix-mysql-extension-in-wordpress\/\"><strong>Easy Guide to MySQL Extension in WordPress<\/strong><\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Using PHP to Interact with MySQL: Executing SQL Queries Through PHP<\/strong><\/h2>\n\n\n\n<p>How to Check Version MySQL in <a href=\"https:\/\/arzhost.com\/blogs\/how-to-show-hidden-files-in-linux\/\"><strong>Linux<\/strong><\/a>? You may find out the version of the MySQL server using PHP if you are using shared hosting and don&#8217;t have access to the command line or a MySQL client like PHPMyAdmin.<\/p>\n\n\n\n<p>Using an FTP or SFTP client, upload the subsequent PHP file to the document root directory of your website. As soon as you switch my user and my password to a real MySQL user account, be sure to:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>MySQL-version.php<\/code><\/li>\n\n\n\n<li><code>&lt;? php<\/code><\/li>\n\n\n\n<li><code>\/\/ Create a database connection.<\/code><\/li>\n\n\n\n<li><code>$link = mysqli_connect (\"localhost\", \"my_user\", \"my password\");<\/code><\/li>\n\n\n\n<li><code>\/\/ Print the MySQL version.<\/code><\/li>\n\n\n\n<li><code>echo mysqli_get_server_info($link);<\/code><\/li>\n\n\n\n<li><code>\/\/ Close the connection.<\/code><\/li>\n\n\n\n<li><code>mysqli_close($link);<\/code><\/li>\n<\/ul>\n\n\n\n<p><u>Open the file in your browser and the version of the MySQL server will be displayed on your screen:<\/u><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>7.27-0ubuntu0.18.04.1<\/code><\/li>\n<\/ul>\n\n\n\n<div class=\"wp-block-uagb-call-to-action uagb-block-b070f091 wp-block-button uag-blocks-common-selector\" style=\"--z-index-desktop:479;;--z-index-tablet:undefined;;--z-index-mobile:undefined;\"><div class=\"uagb-cta__wrap\"><h4 class=\"uagb-cta__title\"><a href=\"https:\/\/arzhost.com\/vps\/\" data-type=\"link\" data-id=\"https:\/\/arzhost.com\/vps\/\">Get Unlimited Power with VPS Hosting &#8211; Best Plans Available<\/a><\/h4><p class=\"uagb-cta__desc\">Unlock the Potential of VPS Hosting &#8211; Starter Plan starts at just <strong>$12.50\/month<\/strong><\/p><\/div><div class=\"uagb-cta__buttons\"><a href=\"https:\/\/arzhost.com\/vps\/\" class=\"uagb-cta__button-link-wrapper wp-block-button__link\" target=\"_self\" rel=\"noopener noreferrer\">Read More<\/a><\/div><\/div>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Conclusion<\/strong>: Final Tips for Effective Database Management<\/h2>\n\n\n\n<p>How to Check Version MySQL in Linux? Finding the MySQL server&#8217;s version is a fairly simple process. This tutorial has several different methods for determining the version of MySQL that is installed on your machine.<\/p>\n\n\n\n<p>If you have any questions, don&#8217;t hesitate to leave a remark. For scalable and reliable hosting, Visit <a href=\"https:\/\/arzhost.com\/\"><strong>ARZ Host<\/strong><\/a>.<\/p>\n\n\n\n<p><strong>Read More:<\/strong><\/p>\n\n\n<ul class=\"wp-block-latest-posts__list wp-block-latest-posts\"><li><a class=\"wp-block-latest-posts__post-title\" href=\"https:\/\/arzhost.com\/blogs\/how-to-fix-403-forbidden-error-wordpress\/\">How To Fix 403 Forbidden Error WordPress<\/a><\/li>\n<li><a class=\"wp-block-latest-posts__post-title\" href=\"https:\/\/arzhost.com\/blogs\/how-to-get-the-most-out-of-claude-ai\/\">How To Get The Most Out Of Claude Ai<\/a><\/li>\n<li><a class=\"wp-block-latest-posts__post-title\" href=\"https:\/\/arzhost.com\/blogs\/bad-gateway-error-502-the-ultimate-guide-to-quick-fixes\/\">Bad Gateway Error (502): The Ultimate Guide to Quick Fixes<\/a><\/li>\n<li><a class=\"wp-block-latest-posts__post-title\" href=\"https:\/\/arzhost.com\/blogs\/a-deep-dive-into-todays-best-linux-distros\/\">A Deep Dive Into Today\u2019s Best Linux Distros<\/a><\/li>\n<li><a class=\"wp-block-latest-posts__post-title\" href=\"https:\/\/arzhost.com\/blogs\/domain-investor-terms-powerful-strategy\/\">Domain Investor Terms: Expert Insight on Powerful Strategy<\/a><\/li>\n<\/ul>","protected":false},"excerpt":{"rendered":"<p>Overview of MySQL Database Management How to Check Version MySQL in Linux? The most widely used open-source relational database management system is MySQL (and its direct replacement Maria DB). Knowing which version of MySQL is installed on your server may be crucial in particular circumstances because there are some significant differences between them. For instance, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":6347,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[31,30],"tags":[],"class_list":["post-4061","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux","category-mysql"],"_links":{"self":[{"href":"https:\/\/arzhost.com\/blogs\/wp-json\/wp\/v2\/posts\/4061","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/arzhost.com\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/arzhost.com\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/arzhost.com\/blogs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/arzhost.com\/blogs\/wp-json\/wp\/v2\/comments?post=4061"}],"version-history":[{"count":4,"href":"https:\/\/arzhost.com\/blogs\/wp-json\/wp\/v2\/posts\/4061\/revisions"}],"predecessor-version":[{"id":11102,"href":"https:\/\/arzhost.com\/blogs\/wp-json\/wp\/v2\/posts\/4061\/revisions\/11102"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/arzhost.com\/blogs\/wp-json\/wp\/v2\/media\/6347"}],"wp:attachment":[{"href":"https:\/\/arzhost.com\/blogs\/wp-json\/wp\/v2\/media?parent=4061"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/arzhost.com\/blogs\/wp-json\/wp\/v2\/categories?post=4061"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/arzhost.com\/blogs\/wp-json\/wp\/v2\/tags?post=4061"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}