{"id":187,"date":"2018-09-29T14:43:39","date_gmt":"2018-09-29T18:43:39","guid":{"rendered":"https:\/\/www.phmsciences.com\/blog\/?p=187"},"modified":"2019-10-12T14:51:16","modified_gmt":"2019-10-12T18:51:16","slug":"upgrading-to-mariadb-10-2-on-centos-7","status":"publish","type":"post","link":"https:\/\/www.phmsciences.com\/blog\/upgrading-to-mariadb-10-2-on-centos-7\/","title":{"rendered":"Upgrading from MariaDB 5.5 to MariaDB 10.2 on CentOS 7"},"content":{"rendered":"<p>By default, CentOS 7 uses MariaDB 5.5. Newer versions of MariaDB are available from <a href=\"https:\/\/www.softwarecollections.org\">Software Collections<\/a>. Here is the code I used on a few different servers to change the SQL database version from MariaDB 5.5 to 10.2:<\/p>\n<p><code># Install MariaDB 10.2. You might need to add the Software Collections repo beforehand.<br \/>\nyum install rh-mariadb102-mariadb-server<\/code><\/p>\n<p><code><br \/>\n# Stop MariaDB 5.5<br \/>\n# Copy databases to MariaDB 10.2<br \/>\n# Set owner<br \/>\n# Start MariaDB 10.2<br \/>\nsystemctl stop mariadb; cp -r \/var\/lib\/mysql \/var\/opt\/rh\/rh-mariadb102\/lib; chown -R mysql:mysql \/var\/opt\/rh\/rh-mariadb102\/lib\/mysql; systemctl start rh-mariadb102-mariadb<\/code><\/p>\n<p><code># Add MariaDB 10.2 to path<br \/>\nscl enable rh-mariadb102 bash<\/code><\/p>\n<p><code># Check that PATH is set correctly<br \/>\nwhich mysql_upgrade<\/code><\/p>\n<p><code># If path to mysql_upgrade is \/usr\/bin\/, then it wasn't successfully changed. Try running:<br \/>\nsource \/opt\/rh\/rh-mariadb102\/enable<\/code><\/p>\n<p><code><code># Upgrade the copied databases<br \/>\nmysql_upgrade -p<em>[PASSWORD]<\/em><\/code><\/code><\/p>\n<p><code><code># Disable MariaDB 5.5 to start on boot<br \/>\nsystemctl disable mariadb<\/code><\/code><\/p>\n<p><code><code># Enable MariaDB 10.2 to start on boot<br \/>\nsystemctl enable rh-mariadb102-mariadb<\/code><\/code><\/p>\n<p><code># Add MariaDB 10.2 to path on boot<br \/>\ncp \/opt\/rh\/rh-mariadb102\/enable \/etc\/profile.d\/rh-mariadb102.sh<br \/>\n<\/code><\/p>\n<p>Don&#8217;t forget to edit your new database configuration file, which is located at <code>\/etc\/opt\/rh\/rh-mariadb102\/my.cnf<\/code>. Your old configuration will be at <code>\/etc\/my.cnf<\/code>.<\/p>\n<p>Good luck!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>By default, CentOS 7 uses MariaDB 5.5. Newer versions of MariaDB are available from Software Collections. Here is the code I used on a few different servers to change the SQL database version from MariaDB 5.5 to 10.2: # Install MariaDB 10.2. You might need to add the Software Collections repo beforehand. yum install rh-mariadb102-mariadb-server [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[19,1],"tags":[21,20,22,23],"class_list":["post-187","post","type-post","status-publish","format-standard","hentry","category-linux","category-uncategorized","tag-centos","tag-linux","tag-mariadb","tag-sql"],"_links":{"self":[{"href":"https:\/\/www.phmsciences.com\/blog\/wp-json\/wp\/v2\/posts\/187","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.phmsciences.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.phmsciences.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.phmsciences.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.phmsciences.com\/blog\/wp-json\/wp\/v2\/comments?post=187"}],"version-history":[{"count":41,"href":"https:\/\/www.phmsciences.com\/blog\/wp-json\/wp\/v2\/posts\/187\/revisions"}],"predecessor-version":[{"id":309,"href":"https:\/\/www.phmsciences.com\/blog\/wp-json\/wp\/v2\/posts\/187\/revisions\/309"}],"wp:attachment":[{"href":"https:\/\/www.phmsciences.com\/blog\/wp-json\/wp\/v2\/media?parent=187"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.phmsciences.com\/blog\/wp-json\/wp\/v2\/categories?post=187"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.phmsciences.com\/blog\/wp-json\/wp\/v2\/tags?post=187"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}