{"id":3630,"date":"2020-02-23T15:48:42","date_gmt":"2020-02-23T15:48:42","guid":{"rendered":"https:\/\/lamp.ciscoar.com\/?page_id=3630"},"modified":"2020-02-23T20:00:19","modified_gmt":"2020-02-23T20:00:19","slug":"mariadb-and-mysql-compatibility","status":"publish","type":"page","link":"https:\/\/lamp.ciscoar.com\/?page_id=3630","title":{"rendered":"MariaDB and MySQL compatibility"},"content":{"rendered":"\n\n\n<h2 class=\"wp-block-heading\">mysql<\/h2>\n\n\n\n<p>As soon as you start working with MariaDB you&#8217;ll notice its compatibility with MySQL, in fact every time you log into the MariaDB console using the &#8220;<strong>mysql<\/strong>&#8221; CLI command you must realize that you are using exactly the same CLI command that would be used on MySQL.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"vim\" class=\"language-vim\">mysql -u root -p<\/code><\/pre>\n\n\n\n<p>In case you are wondering, the &#8220;<strong>-u<\/strong>&#8221; option is used to tell the system which user is going to log into MySQL and the &#8220;<strong>-p<\/strong>&#8221; option tell the system to ask for the &#8220;password&#8221; for that particular user.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">mysqladmin<\/h2>\n\n\n\n<p>Another CLI command that clearly shows the compatibility between MariaDB and MySQL is the &#8220;mysqladmin&#8221; CLI command, that can be used to manage tables and databases, and the server itself, things like checking server&#8217;s status and usage, Start and Stop the server, and also manage users.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"vim\" class=\"language-vim\">mysqladmin -p version status<\/code><\/pre>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><a href=\"https:\/\/lamp.ciscoar.com\/wp-content\/uploads\/2020\/02\/MariaDB-CLI-mysqladmin-version-status.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/lamp.ciscoar.com\/wp-content\/uploads\/2020\/02\/MariaDB-CLI-mysqladmin-version-status-1024x327.jpg\" alt=\"\" class=\"wp-image-3640\" width=\"768\" height=\"245\" srcset=\"https:\/\/lamp.ciscoar.com\/wp-content\/uploads\/2020\/02\/MariaDB-CLI-mysqladmin-version-status-1024x327.jpg 1024w, https:\/\/lamp.ciscoar.com\/wp-content\/uploads\/2020\/02\/MariaDB-CLI-mysqladmin-version-status-300x96.jpg 300w, https:\/\/lamp.ciscoar.com\/wp-content\/uploads\/2020\/02\/MariaDB-CLI-mysqladmin-version-status-768x245.jpg 768w, https:\/\/lamp.ciscoar.com\/wp-content\/uploads\/2020\/02\/MariaDB-CLI-mysqladmin-version-status.jpg 1170w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/a><figcaption>mysqladmin<\/figcaption><\/figure><\/div>\n\n\n\n<p>This tool has the advantage that can be used without having to log into the console, that makes of &#8220;<em>mysqladmin<\/em>&#8221; the perfect tool to be used on non-interactive scripts, utilities like this one are usually called &#8220;external tools&#8221;.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">mysql utilities list<\/h2>\n\n\n\n<p>You can run the following CLI command to see the list of mysql utilities available inside the folder \/usr\/sbin\/<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"vim\" class=\"language-vim\">ls -la \/usr\/bin | grep \"mysql\"<\/code><\/pre>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><a href=\"https:\/\/lamp.ciscoar.com\/wp-content\/uploads\/2020\/02\/MariaDB-mysql-compatibility-utilities-list.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"810\" height=\"612\" src=\"https:\/\/lamp.ciscoar.com\/wp-content\/uploads\/2020\/02\/MariaDB-mysql-compatibility-utilities-list.jpg\" alt=\"\" class=\"wp-image-3644\" srcset=\"https:\/\/lamp.ciscoar.com\/wp-content\/uploads\/2020\/02\/MariaDB-mysql-compatibility-utilities-list.jpg 810w, https:\/\/lamp.ciscoar.com\/wp-content\/uploads\/2020\/02\/MariaDB-mysql-compatibility-utilities-list-300x227.jpg 300w, https:\/\/lamp.ciscoar.com\/wp-content\/uploads\/2020\/02\/MariaDB-mysql-compatibility-utilities-list-768x580.jpg 768w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/a><\/figure><\/div>\n\n\n\n<p>You can tell these all are executable files by looking at the permissions, the &#8220;x&#8221; for the Owner, Group and Other, another important thing to notice is the location <strong>\/usr\/bin<\/strong> is included in the environmental variable <strong>$PATH<\/strong>.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><a href=\"https:\/\/lamp.ciscoar.com\/wp-content\/uploads\/2020\/02\/echo-path.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/lamp.ciscoar.com\/wp-content\/uploads\/2020\/02\/echo-path.jpg\" alt=\"\" class=\"wp-image-3649\" width=\"599\" height=\"151\" srcset=\"https:\/\/lamp.ciscoar.com\/wp-content\/uploads\/2020\/02\/echo-path.jpg 599w, https:\/\/lamp.ciscoar.com\/wp-content\/uploads\/2020\/02\/echo-path-300x76.jpg 300w\" sizes=\"auto, (max-width: 599px) 100vw, 599px\" \/><\/a><figcaption>Environmental Variable $PATH<\/figcaption><\/figure><\/div>\n\n\n\n<p><strong>$PATH<\/strong> is an environment variable used to specify a set of directories where executable programs are located.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Commonly used mysql utilities<\/h2>\n\n\n\n<p>Here you are a list of the most commonly used mysql utilities<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>mysql<\/li><li>mysqladmin<\/li><li>mysql_secure_installation<\/li><li>mysqldump<\/li><li>mysqlimport<\/li><li>mysqlbinlog<\/li><\/ul>\n","protected":false},"excerpt":{"rendered":"<p>mysql As soon as you start working with MariaDB you&#8217;ll notice its compatibility with MySQL, in fact every time you log into the MariaDB console using the &#8220;mysql&#8221; CLI command you must realize that you are using exactly the same CLI command that would be used on MySQL. In case you are wondering, the &#8220;-u&#8221; &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/lamp.ciscoar.com\/?page_id=3630\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;MariaDB and MySQL compatibility&#8221;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-3630","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/lamp.ciscoar.com\/index.php?rest_route=\/wp\/v2\/pages\/3630","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lamp.ciscoar.com\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/lamp.ciscoar.com\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/lamp.ciscoar.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/lamp.ciscoar.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3630"}],"version-history":[{"count":22,"href":"https:\/\/lamp.ciscoar.com\/index.php?rest_route=\/wp\/v2\/pages\/3630\/revisions"}],"predecessor-version":[{"id":3664,"href":"https:\/\/lamp.ciscoar.com\/index.php?rest_route=\/wp\/v2\/pages\/3630\/revisions\/3664"}],"wp:attachment":[{"href":"https:\/\/lamp.ciscoar.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3630"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}