{"id":199,"date":"2013-01-13T16:40:59","date_gmt":"2013-01-13T15:40:59","guid":{"rendered":"http:\/\/blog.johannes-beck.name\/?p=199"},"modified":"2013-01-13T16:42:10","modified_gmt":"2013-01-13T15:42:10","slug":"upgrade-from-mysql-to-mariadb-on-centos-6","status":"publish","type":"post","link":"https:\/\/blog.johannes-beck.name\/?p=199","title":{"rendered":"Upgrade from MySQL to MariaDB on Centos 6"},"content":{"rendered":"<p>This afternoon I updated my Centos 6.3 VM and choose to drop the MySQL 5.1 and give the MariaDB fork a try. I&#8217;ve found several steps to do and some problems to take of &#8211; all of them described somewhere else. It may be useful for somebody doing the same upgrade to have my collection of tasks to do. <\/p>\n<p>So this is the starting point:<\/p>\n<ul>\n<li>Centos 6.3 (x66) running<\/li>\n<li>mysql-server (5.1)<\/li>\n<li>phpmysqladmin (2.11.11.3)<\/li>\n<li>several applications which are using the MySQL server<\/li>\n<\/ul>\n<p>and here it is how I did the upgrade:<\/p>\n<p>1. Stop mysql: <code>\/etc\/init.d\/mysql stop<\/code><br \/>\n2. Backup mysql database: <code>mv \/var\/lib\/mysql \/var\/lib\/mysql.bak<\/code><br \/>\nAlternatively you should do a backup of your databases with mysqldump.<br \/>\n3. Install the remi repo (<a href=\"http:\/\/www.tecmint.com\/install-phpmyadmin-for-apache-or-nginx-on-rhelcentos-6-3-5-8-fedora-17-12\/\">if you are using a are different distro or arch<\/a>): <code>rpm -Uvh http:\/\/rpms.famillecollet.com\/enterprise\/remi-release-6.rpm<\/code><br \/>\nYou need to enable the repo manually.<br \/>\n4. Remove old phpmyadmin (which has no support for MariaDB): <code>yum remove phpmyadmin <\/code><br \/>\n5. Install current phpmyadmin (with MariaDB support): <code>yum install phpMyAdmin<\/code><br \/>\n6. Import PGP key for the mariadb repo: <code>rpm --import https:\/\/yum.mariadb.org\/RPM-GPG-KEY-MariaDB<\/code><br \/>\nThe id of the signing key is 0xcbcb082a1bb943db.<br \/>\nThe short form of the id is 0x1BB943DB and the full key fingerprint is 1993 69E5 404B D5FC 7D2F E43B CBCB 082A 1BB9 43DB.<br \/>\n7. Create \/etc\/yum.repos.d\/mariadb.repo with the help of the <a href=\"http:\/\/downloads.mariadb.org\/mariadb\/repositories\/\">repository-generator<\/a> at mariabb.org:<br \/>\n<code>[mariadb]<br \/>\nname = MariaDB<br \/>\nbaseurl = http:\/\/yum.mariadb.org\/5.5\/centos6-x86<br \/>\ngpgkey=https:\/\/yum.mariadb.org\/RPM-GPG-KEY-MariaDB<br \/>\ngpgcheck=1<br \/>\nenabled=1<\/code><br \/>\n<a href=\"See https:\/\/kb.askmonty.org\/en\/installing-mariadb-with-yum\">More info<\/a><br \/>\n8. install compat library: <code>yum --enablerepo=remi-test --disablerepo=remi install compat-mysql55<\/code><br \/>\n9. install MariaDB: <code>yum install MariaDB-devel MariaDB-client MariaDB-server<\/code><br \/>\nif you are running into problems with these two steps because of dependencies or conflicts, you may need to erase the mysql-libs manually: <code>rpm -e --nodeps mysql-libs<\/code><br \/>\n10. Restore mysql config in \/etc\/my.conf.d\/server.conf from \/etc\/my.cnf.rpmsave; in my case I readded these values:<br \/>\n<code>[mysqld]<br \/>\nlog-error=\/var\/lib\/mysql\/mysqld.log<br \/>\nlog_warnings = 2<br \/>\nmax_allowed_packet = 32M<br \/>\ndefault-storage-engine=innodb<\/code><br \/>\n11. If you had already a database, restore it before starting the database:<br \/>\n<code>mv \/var\/lib\/mysql \/var\/lib\/mysql.new<br \/>\nmv \/var\/lib\/mysql.bak\/ \/var\/lib\/mysql<\/code><br \/>\n12. start the mysql server: <code>\/etc\/init.d\/mysql start<\/code><br \/>\n13. upgrade the mysql database: <code>mysql_upgrade<\/code><br \/>\nIf you starting with a new database, set the root password:<br \/>\n<code>mysqladmin -u root password '&lt;PASSWORD&gt;'<br \/>\nmysqladmin -u root -h <HOSTNAME> password '&lt;PASSWORD&gt;'<\/code><br \/>\n14. Login to mysql:<br \/>\n<code>mysql<\/p>\n<p>Welcome to the MariaDB monitor.  Commands end with ; or \\g.<br \/>\nYour MariaDB connection id is 60<br \/>\nServer version: 5.5.28a-MariaDB MariaDB Server<\/p>\n<p>Copyright (c) 2000, 2012, Oracle, Monty Program Ab and others.<\/p>\n<p>Type 'help;' or '\\h' for help. Type '\\c' to clear the current input statement.<\/code><br \/>\n15. Show status:<br \/>\n<code>&lt;status<br \/>\n--------------<br \/>\nmysql  Ver 15.1 Distrib 5.5.28a-MariaDB, for Linux (i686) using readline 5.1<\/p>\n<p>Connection id:          59<br \/>\nCurrent database:<br \/>\nCurrent user:           root@localhost<br \/>\nSSL:                    Not in use<br \/>\nCurrent pager:          stdout<br \/>\nUsing outfile:          ''<br \/>\nUsing delimiter:        ;<br \/>\nServer:                 MariaDB<br \/>\nServer version:         5.5.28a-MariaDB MariaDB Server<br \/>\nProtocol version:       10<br \/>\nConnection:             Localhost via UNIX socket<br \/>\nServer characterset:    latin1<br \/>\nDb     characterset:    latin1<br \/>\nClient characterset:    utf8<br \/>\nConn.  characterset:    utf8<br \/>\nUNIX socket:            \/var\/lib\/mysql\/mysql.sock<br \/>\nUptime:                 53 min 1 sec<\/p>\n<p>Threads: 6  Questions: 2307  Slow queries: 0  Opens: 75  Flush tables: 1  Open tables: 50  Queries per second avg: 0.725<br \/>\n--------------<\/code><\/p>\n<p>if you see a similar output your upgrade is complete.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This afternoon I updated my Centos 6.3 VM and choose to drop the MySQL 5.1 and give the MariaDB fork a try. I&#8217;ve found several steps to do and some problems to take of &#8211; all of them described somewhere else. It may be useful for somebody doing the same upgrade to have my collection [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[36,3],"tags":[33,65,34,35],"class_list":["post-199","post","type-post","status-publish","format-standard","hentry","category-linux","category-software-development","tag-centos","tag-linux","tag-mariadb","tag-mysql"],"_links":{"self":[{"href":"https:\/\/blog.johannes-beck.name\/index.php?rest_route=\/wp\/v2\/posts\/199","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.johannes-beck.name\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.johannes-beck.name\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.johannes-beck.name\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.johannes-beck.name\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=199"}],"version-history":[{"count":10,"href":"https:\/\/blog.johannes-beck.name\/index.php?rest_route=\/wp\/v2\/posts\/199\/revisions"}],"predecessor-version":[{"id":209,"href":"https:\/\/blog.johannes-beck.name\/index.php?rest_route=\/wp\/v2\/posts\/199\/revisions\/209"}],"wp:attachment":[{"href":"https:\/\/blog.johannes-beck.name\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=199"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.johannes-beck.name\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=199"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.johannes-beck.name\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=199"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}