{"id":3891,"date":"2018-05-04T18:18:59","date_gmt":"2018-05-04T14:18:59","guid":{"rendered":"https:\/\/nayarweb.com\/blog\/?p=3891"},"modified":"2018-05-04T18:19:33","modified_gmt":"2018-05-04T14:19:33","slug":"upgrading-from-mysql-to-mariadb-on-ubuntu-server-16-04lts","status":"publish","type":"post","link":"https:\/\/nayarweb.com\/blog\/2018\/upgrading-from-mysql-to-mariadb-on-ubuntu-server-16-04lts\/","title":{"rendered":"Upgrading from MySQL to MariaDB on Ubuntu Server 16.04LTS"},"content":{"rendered":"<p>Let&#8217;s see which version of MySQL is installed<\/p>\n<pre>root@mysql-bak:~# dpkg -l | grep mysql\r\nii  mysql-client-5.7                 5.7.22-0ubuntu0.16.04.1  \r\nii  mysql-client-core-5.7            5.7.22-0ubuntu0.16.04.1  \r\nii  mysql-common                     5.7.22-0ubuntu0.16.04.1\r\nii  mysql-server                     5.7.22-0ubuntu0.16.04.1 \r\nii  mysql-server-5.7                 5.7.22-0ubuntu0.16.04.1  \r\nii  mysql-server-core-5.7            5.7.22-0ubuntu0.16.04.1\r\n<\/pre>\n<p>Rumour says that MariaDB is a &#8220;drop-in&#8221; replacement for MySQL. Let&#8217;s try install MariaDB as is.<\/p>\n<pre>reimport them hereroot@mysql-bak:~# apt-get install mariadb-server\r\nReading package lists... Done\r\nBuilding dependency tree       \r\nReading state information... Done\r\nThe following package was automatically installed and is no longer required:\r\n  libevent-core-2.0-5\r\nUse 'apt autoremove' to remove it.\r\nThe following additional packages will be installed:\r\n  libdbd-mysql-perl libdbi-perl libmysqlclient20 libterm-readkey-perl mariadb-client-10.0 mariadb-client-core-10.0 mariadb-common mariadb-server-10.0 mariadb-server-core-10.0\r\nSuggested packages:\r\n  libclone-perl libmldbm-perl libnet-daemon-perl libsql-statement-reimport them hereperl mailx mariadb-test tinyca\r\nThe following packages will be REMOVED:\r\n  mysql-client-5.7 mysql-client-core-5.7 mysql-server mysql-server-5.7 mysql-server-core-5.7\r\nThe following NEW packages will be installed:\r\n  libdbd-mysql-perl libdbi-perl libmysqlclient20 libterm-readkey-perl mariadb-client-10.0 mariadb-client-core-10.0 mariadb-common mariadb-server mariadb-server-10.0 mariadb-server-core-10.0\r\n0 upgraded, 10 newly installed, 5 to remove and 0 not upgraded.\r\nNeed to get 16.3 MB of archives.\r\nAfter this operation, 15.2 MB disk space will be freed.\r\nDo you want to continue? [Y\/n]<\/pre>\n<p>And we press Y!<\/p>\n<p><a href=\"https:\/\/nayarweb.com\/blog\/2018\/upgrading-from-mysql-to-mariadb-on-ubuntu-server-16-04lts\/screenshot_20180504_123555\/\" rel=\"attachment wp-att-3892\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-3892\" src=\"https:\/\/nayarweb.com\/blog\/wp-content\/uploads\/2018\/05\/Screenshot_20180504_123555-1024x179.png\" alt=\"The old data directory will be saved at new location. \u2502 \u2502 A file named \/var\/lib\/mysql\/debian-*.flag exists on this system. The number indicated \u2502 \u2502 Therefore the previous data directory will be renamed to \/var\/lib\/mysql-* and a new d \u2502 \u2502 Please manually export\/import your data (e.g. with mysqldump) if needed.\" width=\"640\" height=\"112\" srcset=\"https:\/\/nayarweb.com\/blog\/wp-content\/uploads\/2018\/05\/Screenshot_20180504_123555-1024x179.png 1024w, https:\/\/nayarweb.com\/blog\/wp-content\/uploads\/2018\/05\/Screenshot_20180504_123555-300x52.png 300w, https:\/\/nayarweb.com\/blog\/wp-content\/uploads\/2018\/05\/Screenshot_20180504_123555-768x134.png 768w, https:\/\/nayarweb.com\/blog\/wp-content\/uploads\/2018\/05\/Screenshot_20180504_123555-1272x222.png 1272w, https:\/\/nayarweb.com\/blog\/wp-content\/uploads\/2018\/05\/Screenshot_20180504_123555.png 1276w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/a><\/p>\n<p>And all your data is not accessible.<\/p>\n<p><a href=\"https:\/\/nayarweb.com\/blog\/2018\/upgrading-from-mysql-to-mariadb-on-ubuntu-server-16-04lts\/screenshot_20180504_170418\/\" rel=\"attachment wp-att-3893\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-3893\" src=\"https:\/\/nayarweb.com\/blog\/wp-content\/uploads\/2018\/05\/Screenshot_20180504_170418.png\" alt=\"\" width=\"555\" height=\"244\" srcset=\"https:\/\/nayarweb.com\/blog\/wp-content\/uploads\/2018\/05\/Screenshot_20180504_170418.png 555w, https:\/\/nayarweb.com\/blog\/wp-content\/uploads\/2018\/05\/Screenshot_20180504_170418-300x132.png 300w\" sizes=\"auto, (max-width: 555px) 100vw, 555px\" \/><\/a><\/p>\n<p>You&#8217;ll need to have MariaDB 10.1 or higher which can import MySQL data.<\/p>\n<pre>\r\nsudo apt-get install software-properties-common\r\nsudo apt-key adv --recv-keys --keyserver hkp:\/\/keyserver.ubuntu.com:80 0xF1656F24C74CD1D8\r\nsudo add-apt-repository 'deb [arch=amd64,i386,ppc64el] http:\/\/mariadb.mirrors.ovh.net\/MariaDB\/repo\/10.2\/ubuntu xenial main'\r\nsudo apt update\r\nsudo apt install mariadb-server\r\n<\/pre>\n<p>You database should now be MariaDB \ud83d\ude09<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Let&#8217;s see which version of MySQL is installed root@mysql-bak:~# dpkg -l | grep mysql ii mysql-client-5.7 5.7.22-0ubuntu0.16.04.1 ii mysql-client-core-5.7 5.7.22-0ubuntu0.16.04.1 ii mysql-common 5.7.22-0ubuntu0.16.04.1 ii mysql-server 5.7.22-0ubuntu0.16.04.1 ii mysql-server-5.7 5.7.22-0ubuntu0.16.04.1 ii mysql-server-core-5.7 5.7.22-0ubuntu0.16.04.1 Rumour says that MariaDB is a &#8220;drop-in&#8221; replacement for MySQL. Let&#8217;s try install MariaDB as is. reimport them hereroot@mysql-bak:~# apt-get install mariadb-server Reading &hellip; <a href=\"https:\/\/nayarweb.com\/blog\/2018\/upgrading-from-mysql-to-mariadb-on-ubuntu-server-16-04lts\/\" class=\"continue-reading\">Continue reading <span class=\"screen-reader-text\">Upgrading from MySQL to MariaDB on Ubuntu Server 16.04LTS<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[210],"tags":[],"class_list":["post-3891","post","type-post","status-publish","format-standard","hentry","category-technology"],"_links":{"self":[{"href":"https:\/\/nayarweb.com\/blog\/wp-json\/wp\/v2\/posts\/3891","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nayarweb.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nayarweb.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nayarweb.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/nayarweb.com\/blog\/wp-json\/wp\/v2\/comments?post=3891"}],"version-history":[{"count":3,"href":"https:\/\/nayarweb.com\/blog\/wp-json\/wp\/v2\/posts\/3891\/revisions"}],"predecessor-version":[{"id":3897,"href":"https:\/\/nayarweb.com\/blog\/wp-json\/wp\/v2\/posts\/3891\/revisions\/3897"}],"wp:attachment":[{"href":"https:\/\/nayarweb.com\/blog\/wp-json\/wp\/v2\/media?parent=3891"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nayarweb.com\/blog\/wp-json\/wp\/v2\/categories?post=3891"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nayarweb.com\/blog\/wp-json\/wp\/v2\/tags?post=3891"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}