{"id":5851,"date":"2013-02-22T09:33:40","date_gmt":"2013-02-22T15:33:40","guid":{"rendered":"http:\/\/blog.cpanel.net\/?p=5851"},"modified":"2013-02-22T09:33:40","modified_gmt":"2013-02-22T15:33:40","slug":"mysql-mariadb","status":"publish","type":"post","link":"https:\/\/devel.www.cpanel.net\/blog\/tips-and-tricks\/mysql-mariadb\/","title":{"rendered":"How to replace MySQL with MariaDB in 11.36+"},"content":{"rendered":"
UPDATE<\/strong>:\u00a0As of cPanel & WHM 11.48 we now support MariaDB natively, and this guide no longer needs to be followed. Please read about that in the 11.48 release notes<\/a>.<\/em><\/div>\n
\n
\n<\/div>\n
<\/a>Important: <\/strong>This setup is considered to be unsupported by the cPanel\/WHM team. Please note that once cPanel\/WHM no longer maintains MySQL on your system it is on the Systems Administrator to manage and maintain any updates and maintenance on the database software. \u00a0We recommend only experienced systems administrators perform the above and we are not responsible for any possible data loss.<\/div>\n
<\/a>Important: <\/strong>This guide may or may not work if you are utilizing MySQL 5.6 as MariaDB currently only has 5.5 and 10.0 which is a port off of 5.5 with some of 5.6 ported into it. Proceed at your own risk.<\/div>\n

Below you will find some steps on how to affectively stop cPanel\/WHM from maintaining MySQL and begin utilizing MariaDB for any and all database activity on your server. MariaDB is “An enhanced, drop-in replacement for MySQL” (Source: https:\/\/mariadb.com\/<\/a>). The guide found below is based around utilizing the new RPM tools we provide in 11.36. Important Links<\/strong> MariaDB Versus MySQL Compatibility<\/a> MariaDB Versus MySQL Features<\/a> Documentation on the RPM system provided by cPanel & WHM<\/em><\/a> Step 1: Backup existing MySQL\u00a0data<\/strong> Make sure to save all existing data just in case there are any issues.<\/p>\n

cp -Rf \/var\/lib\/mysql \/var\/lib\/mysql-old\nmv \/etc\/my.cnf \/etc\/my.cnf-old<\/pre>\n

Step 2: Disable the targets so cPanel no longer handles MySQL\u00a0updates<\/strong> The following will mark the versions of MySQL\u00a0we distribute as uninstalled so they are no longer maintained by cPanel\/WHM<\/p>\n

\/usr\/local\/cpanel\/scripts\/update_local_rpm_versions --edit target_settings.MySQL50 uninstalled\n\/usr\/local\/cpanel\/scripts\/update_local_rpm_versions --edit target_settings.MySQL51 uninstalled<\/pre>\n

Step 3: Remove existing MySQL\u00a0RPM’s so theres a clean slate for\u00a0MariaDB<\/strong><\/p>\n

<\/a>Important:<\/strong>\u00a0The below command will uninstall the MySQL\u00a0RPM’s!<\/div>\n
\/usr\/local\/cpanel\/scripts\/check_cpanel_rpms --fix --targets=MySQL50,MySQL51,MySQL55<\/pre>\n
[20130218.235953]    \n[20130218.235953]   The following RPMs are unneeded on your system and should be uninstalled:\n[20130218.235953]   MySQL51-devel.5.1.68-1.cp1136\n[20130218.235953]   MySQL51-test.5.1.68-1.cp1136\n[20130218.235953]   MySQL51-shared.5.1.68-1.cp1136\n[20130218.235953]   MySQL51-client.5.1.68-1.cp1136\n[20130218.235953]   MySQL51-server.5.1.68-1.cp1136\n[20130218.235953]   Removing 0 broken rpms: \n[20130218.235953]   rpm: no packages given for erase\n[20130218.235953]   No new RPMS needed for install\n[20130218.235953]   Uninstalling unneeded rpms: MySQL51-devel MySQL51-test MySQL51-shared MySQL51-client MySQL51-server\n[20130219.000004]   Shutting down MySQL........ SUCCESS!<\/pre>\n

Step 4: Create a yum repository for\u00a0MariaDB<\/strong><\/p>\n

vi \/etc\/yum.repos.d\/MariaDB.repo<\/pre>\n

place the following inside of it depending on the DISTRO and MySQL version (https:\/\/downloads.mariadb.org\/mariadb\/repositories\/):<\/p>\n

[mariadb]\nname = MariaDB\nbaseurl = http:\/\/yum.mariadb.org\/[version]<\/em>\/[osdistro]<\/em>\/\ngpgkey=https:\/\/yum.mariadb.org\/RPM-GPG-KEY-MariaDB\ngpgcheck=1<\/pre>\n

Replace [version] with the equivalent of the version of MySQL you are running. Replace [osdistro] with the operating system you are utilizing. Step 5: Remove php<\/em><\/strong>\u00a0from the \/etc\/yum.conf file then run the following commands <\/strong><\/p>\n

yum install MariaDB-server MariaDB-client MariaDB-devel\n\/etc\/init.d\/mysql start\nmysql_upgrade\n\/etc\/init.d\/mysql restart<\/pre>\n

Step 5: Add php<\/em> back to the \/etc\/yum.conf file to ensure future php updates don’t get clobbered<\/strong> Final Step: Rebuild easyapache\/php to ensure modules are intact\/working<\/strong><\/p>\n

\/usr\/local\/cpanel\/scripts\/easyapache --build<\/pre>\n

 <\/p>\n","protected":false},"excerpt":{"rendered":"

UPDATE:\u00a0As of cPanel & WHM 11.48 we now support MariaDB natively, and this guide no longer needs to be followed. Please read about that in the 11.48 release notes. Important: This setup is considered to be unsupported by the cPanel\/WHM team. Please note that once cPanel\/WHM no longer maintains MySQL on your system it is […]<\/p>\n","protected":false},"author":77,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"footnotes":""},"categories":[61],"tags":[541,545,549,553,557,561],"class_list":["post-5851","post","type-post","status-publish","format-standard","hentry","category-tips-and-tricks","tag-mariadb","tag-mariadb-rpm","tag-mysql","tag-mysql-to-mariadb","tag-mysql-vs-mariadb","tag-replace-mysql-with-mariadb"],"acf":[],"yoast_head":"\nHow to replace MySQL with MariaDB in 11.36+ | cPanel<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=_-1436.html \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to replace MySQL with MariaDB in 11.36+ | cPanel\" \/>\n<meta property=\"og:description\" content=\"UPDATE:\u00a0As of cPanel & WHM 11.48 we now support MariaDB natively, and this guide no longer needs to be followed. Please read about that in the 11.48 release notes. Important: This setup is considered to be unsupported by the cPanel\/WHM team. Please note that once cPanel\/WHM no longer maintains MySQL on your system it is […]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/devel.www.cpanel.net\/blog\/tips-and-tricks\/mysql-mariadb\/\" \/>\n<meta property=\"og:site_name\" content=\"cPanel\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/cpanel\/\" \/>\n<meta property=\"article:published_time\" content=\"2013-02-22T15:33:40+00:00\" \/>\n<meta name=\"author\" content=\"cPanel Community\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@cPanel\" \/>\n<meta name=\"twitter:site\" content=\"@cPanel\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"cPanel Community\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/devel.www.cpanel.net\/blog\/tips-and-tricks\/mysql-mariadb\/\",\"url\":\"https:\/\/devel.www.cpanel.net\/blog\/tips-and-tricks\/mysql-mariadb\/\",\"name\":\"How to replace MySQL with MariaDB in 11.36+ | cPanel\",\"isPartOf\":{\"@id\":\"https:\/\/devel.www.cpanel.net\/#website\"},\"datePublished\":\"2013-02-22T15:33:40+00:00\",\"dateModified\":\"2013-02-22T15:33:40+00:00\",\"author\":{\"@id\":\"https:\/\/devel.www.cpanel.net\/#\/schema\/person\/8cf97408aad4fb70cf55d11a1d4f57f8\"},\"breadcrumb\":{\"@id\":\"https:\/\/devel.www.cpanel.net\/blog\/tips-and-tricks\/mysql-mariadb\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/devel.www.cpanel.net\/blog\/tips-and-tricks\/mysql-mariadb\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/devel.www.cpanel.net\/blog\/tips-and-tricks\/mysql-mariadb\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/devel.www.cpanel.net\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to replace MySQL with MariaDB in 11.36+\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/devel.www.cpanel.net\/#website\",\"url\":\"https:\/\/devel.www.cpanel.net\/\",\"name\":\"cPanel\",\"description\":\"Hosting Platform of Choices\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/devel.www.cpanel.net\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/devel.www.cpanel.net\/#\/schema\/person\/8cf97408aad4fb70cf55d11a1d4f57f8\",\"name\":\"cPanel Community\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/devel.www.cpanel.net\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/e1949945083b5526bb95711bd3d616b3?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/e1949945083b5526bb95711bd3d616b3?s=96&d=mm&r=g\",\"caption\":\"cPanel Community\"},\"description\":\"The web hosting industry's most reliable management solution since 1997. With our first-class support and rich feature set, it's easy to see why our customers and partners make cPanel & WHM their hosting platform of choice. For more information, visit cPanel.net.\",\"sameAs\":[\"https:\/\/cpanel.net\"],\"url\":\"https:\/\/devel.www.cpanel.net\/blog\/author\/cpadmin\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to replace MySQL with MariaDB in 11.36+ | cPanel","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/devel.www.cpanel.net\/blog\/tips-and-tricks\/mysql-mariadb\/","og_locale":"en_US","og_type":"article","og_title":"How to replace MySQL with MariaDB in 11.36+ | cPanel","og_description":"UPDATE:\u00a0As of cPanel & WHM 11.48 we now support MariaDB natively, and this guide no longer needs to be followed. Please read about that in the 11.48 release notes. Important: This setup is considered to be unsupported by the cPanel\/WHM team. Please note that once cPanel\/WHM no longer maintains MySQL on your system it is […]","og_url":"https:\/\/devel.www.cpanel.net\/blog\/tips-and-tricks\/mysql-mariadb\/","og_site_name":"cPanel","article_publisher":"https:\/\/www.facebook.com\/cpanel\/","article_published_time":"2013-02-22T15:33:40+00:00","author":"cPanel Community","twitter_card":"summary_large_image","twitter_creator":"@cPanel","twitter_site":"@cPanel","twitter_misc":{"Written by":"cPanel Community","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/devel.www.cpanel.net\/blog\/tips-and-tricks\/mysql-mariadb\/","url":"https:\/\/devel.www.cpanel.net\/blog\/tips-and-tricks\/mysql-mariadb\/","name":"How to replace MySQL with MariaDB in 11.36+ | cPanel","isPartOf":{"@id":"https:\/\/devel.www.cpanel.net\/#website"},"datePublished":"2013-02-22T15:33:40+00:00","dateModified":"2013-02-22T15:33:40+00:00","author":{"@id":"https:\/\/devel.www.cpanel.net\/#\/schema\/person\/8cf97408aad4fb70cf55d11a1d4f57f8"},"breadcrumb":{"@id":"https:\/\/devel.www.cpanel.net\/blog\/tips-and-tricks\/mysql-mariadb\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/devel.www.cpanel.net\/blog\/tips-and-tricks\/mysql-mariadb\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/devel.www.cpanel.net\/blog\/tips-and-tricks\/mysql-mariadb\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/devel.www.cpanel.net\/"},{"@type":"ListItem","position":2,"name":"How to replace MySQL with MariaDB in 11.36+"}]},{"@type":"WebSite","@id":"https:\/\/devel.www.cpanel.net\/#website","url":"https:\/\/devel.www.cpanel.net\/","name":"cPanel","description":"Hosting Platform of Choices","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/devel.www.cpanel.net\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/devel.www.cpanel.net\/#\/schema\/person\/8cf97408aad4fb70cf55d11a1d4f57f8","name":"cPanel Community","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/devel.www.cpanel.net\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/e1949945083b5526bb95711bd3d616b3?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/e1949945083b5526bb95711bd3d616b3?s=96&d=mm&r=g","caption":"cPanel Community"},"description":"The web hosting industry's most reliable management solution since 1997. With our first-class support and rich feature set, it's easy to see why our customers and partners make cPanel & WHM their hosting platform of choice. For more information, visit cPanel.net.","sameAs":["https:\/\/cpanel.net"],"url":"https:\/\/devel.www.cpanel.net\/blog\/author\/cpadmin\/"}]}},"_links":{"self":[{"href":"https:\/\/devel.www.cpanel.net\/wp-json\/wp\/v2\/posts\/5851"}],"collection":[{"href":"https:\/\/devel.www.cpanel.net\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devel.www.cpanel.net\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devel.www.cpanel.net\/wp-json\/wp\/v2\/users\/77"}],"replies":[{"embeddable":true,"href":"https:\/\/devel.www.cpanel.net\/wp-json\/wp\/v2\/comments?post=5851"}],"version-history":[{"count":0,"href":"https:\/\/devel.www.cpanel.net\/wp-json\/wp\/v2\/posts\/5851\/revisions"}],"wp:attachment":[{"href":"https:\/\/devel.www.cpanel.net\/wp-json\/wp\/v2\/media?parent=5851"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devel.www.cpanel.net\/wp-json\/wp\/v2\/categories?post=5851"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devel.www.cpanel.net\/wp-json\/wp\/v2\/tags?post=5851"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}